WP_Customize_Upload_Control

Customize Upload Control Class.

Defined (1)

The class is defined in the following location(s).

/wp-includes/customize/class-wp-customize-upload-control.php  
  1. class WP_Customize_Upload_Control extends WP_Customize_Media_Control { 
  2. public $type = 'upload'; 
  3. public $mime_type = ''; 
  4. public $button_labels = array(); 
  5. public $removed = ''; // unused 
  6. public $context; // unused 
  7. public $extensions = array(); // unused 
  8.  
  9. /** 
  10. * Refresh the parameters passed to the JavaScript via JSON. 
  11. * @since 3.4.0 
  12. * @uses WP_Customize_Media_Control::to_json() 
  13. */ 
  14. public function to_json() { 
  15. parent::to_json(); 
  16.  
  17. $value = $this->value(); 
  18. if ( $value ) { 
  19. // Get the attachment model for the existing file. 
  20. $attachment_id = attachment_url_to_postid( $value ); 
  21. if ( $attachment_id ) { 
  22. $this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id );