3 * Customize API: WP_Customize_Upload_Control class
6 * @subpackage Customize
11 * Customize Upload Control Class.
15 * @see WP_Customize_Media_Control
17 class WP_Customize_Upload_Control extends WP_Customize_Media_Control {
18 public $type = 'upload';
19 public $mime_type = '';
20 public $button_labels = array();
21 public $removed = ''; // unused
22 public $context; // unused
23 public $extensions = array(); // unused
26 * Refresh the parameters passed to the JavaScript via JSON.
30 * @uses WP_Customize_Media_Control::to_json()
32 public function to_json() {
35 $value = $this->value();
37 // Get the attachment model for the existing file.
38 $attachment_id = attachment_url_to_postid( $value );
39 if ( $attachment_id ) {
40 $this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id );