Ticket #30683: 30683.patch
| File 30683.patch, 2.1 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/class-wp-customize-control.php
708 708 if ( $this->value() ) { 709 709 $attachment_id = attachment_url_to_postid( $this->value() ); 710 710 if ( $attachment_id ) { 711 $this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id );711 $this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id ); 712 712 } 713 713 } else if ( $this->setting->default ) { 714 714 // Set the default as the attachment. … … 741 741 <# } #> 742 742 </label> 743 743 744 <# // Ensure that the default attachment is used if it exists. 745 if ( _.isEmpty( data.attachment ) && data.defaultAttachment ) { 746 data.attachment = data.defaultAttachment; 747 } 748 749 if ( data.attachment && data.attachment.id ) { #> 744 <# if ( data.attachment && data.attachment.id ) { #> 750 745 <div class="current"> 751 746 <div class="container"> 752 747 <div class="attachment-media-view attachment-media-view-{{ data.attachment.type }} {{ data.attachment.orientation }}"> … … 773 768 </div> 774 769 </div> 775 770 <div class="actions"> 776 <# if ( data.defaultAttachment && data.defaultAttachment.id !== data.attachment.id) { #>771 <# if ( data.defaultAttachment ) { #> 777 772 <button type="button" class="button default-button remove-button"><?php echo $this->button_labels['default']; ?></button> 778 <# } else if ( ! data.defaultAttachment ) { #>779 <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>780 773 <# } #> 774 <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button> 781 775 <button type="button" class="button upload-button" id="{{ data.settings.default }}-button"><?php echo $this->button_labels['change']; ?></button> 782 776 <div style="clear:both"></div> 783 777 </div> … … 1177 1171 return $this->manager->widgets->is_widget_rendered( $this->widget_id ); 1178 1172 } 1179 1173 } 1180