- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/customize/class-wp-customize-media-control.php
r42031 r42343 76 76 public function to_json() { 77 77 parent::to_json(); 78 $this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );79 $this->json['mime_type'] = $this->mime_type;78 $this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) ); 79 $this->json['mime_type'] = $this->mime_type; 80 80 $this->json['button_labels'] = $this->button_labels; 81 $this->json['canUpload'] = current_user_can( 'upload_files' );81 $this->json['canUpload'] = current_user_can( 'upload_files' ); 82 82 83 83 $value = $this->value(); … … 87 87 // Fake an attachment model - needs all fields used by template. 88 88 // Note that the default value must be a URL, NOT an attachment ID. 89 $type = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document';89 $type = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document'; 90 90 $default_attachment = array( 91 'id' => 1,92 'url' => $this->setting->default,93 'type' => $type,94 'icon' => wp_mime_type_icon( $type ),91 'id' => 1, 92 'url' => $this->setting->default, 93 'type' => $type, 94 'icon' => wp_mime_type_icon( $type ), 95 95 'title' => basename( $this->setting->default ), 96 96 );
Note: See TracChangeset
for help on using the changeset viewer.