Server IP : 104.21.93.192 / Your IP : 216.73.216.73 Web Server : LiteSpeed System : Linux premium900.web-hosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : redwjova ( 1790) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/redwjova/fyntric.com/wp-content/themes/smart-mag/inc/core/customizer/controls/ |
Upload File : |
<?php /** * Modified WP_Customize_Upload_Control class to allow handling of images that are not * available in the local library. * * Use Case: Imported options where images set may not be in local library. */ /** * Customize Upload Control Class. * * @since 3.4.0 * * @see WP_Customize_Media_Control * @see WP_Customize_Upload_Control * @see WP_Customize_Image_Control */ class Bunyad_Customizer_Controls_Image extends WP_Customize_Image_Control { use Bunyad_Customizer_Controls_BaseTrait; /** * Refresh the parameters passed to the JavaScript via JSON. * * @uses WP_Customize_Media_Control::to_json() */ public function to_json() { $this->base_json(); $value = $this->value(); if ($value) { // Get the attachment model for the existing file. $attachment_id = attachment_url_to_postid($value); if ($attachment_id) { $this->json['attachment'] = wp_prepare_attachment_for_js($attachment_id); } else { // image or doc $type = in_array(substr($value, -3), array('jpg', 'png', 'gif', 'bmp')) ? 'image' : 'document'; // Replicate variables for an attachment for the media control $attachment = array( 'id' => 1, 'url' => $value, 'type' => $type, 'icon' => wp_mime_type_icon( $type ), ); // Add sizes if ($type == 'image') { $attachment['sizes'] = array('full' => array('url' => $value)); } $this->json['attachment'] = $attachment; } } } }