Warning: Undefined array key "yPBFjS" in /home/ic3/domains/ic3.info/public_html/wp-includes/kses.php on line 1
HEX
HEX
Server: LiteSpeed
System: Linux control5.webnow.vn 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: ic3 (1169)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/ic3/public_html/wp-content/themes/flatsome/inc/builder/core/server/src/Ajax/WpAttachment.php
<?php

namespace UxBuilder\Ajax;

class WpAttachment {

  public function get_attachment() {
    $id = intval( $_GET['attachment_id'] );
    $size = array_key_exists( 'attachment_size', $_GET ) ? sanitize_text_field( $_GET['attachment_size'] ) : null;
    $width = array_key_exists( 'attachment_width', $_GET ) ? sanitize_text_field( $_GET['attachment_width'] ) : null;
    $height = array_key_exists( 'attachment_height', $_GET ) ? sanitize_text_field( $_GET['attachment_height'] ) : null;
    $icon = null;

    if( $width || $height ) {
      $size = array( $width, $height );
    }

    if( $attachment = wp_get_attachment_image_src( $id, $size, $icon ) ) {
      return wp_send_json_success( $attachment );
    }

    return wp_send_json_error();
  }
}