Make WordPress Core

Ticket #30683: 30683.patch

File 30683.patch, 2.1 KB (added by ocean90, 11 years ago)

unfinished

  • src/wp-includes/class-wp-customize-control.php

     
    708708                        if ( $this->value() ) {
    709709                                $attachment_id = attachment_url_to_postid( $this->value() );
    710710                                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 );
    712712                                }
    713713                        } else if ( $this->setting->default ) {
    714714                                // Set the default as the attachment.
     
    741741                        <# } #>
    742742                </label>
    743743
    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 ) { #>
    750745                        <div class="current">
    751746                                <div class="container">
    752747                                        <div class="attachment-media-view attachment-media-view-{{ data.attachment.type }} {{ data.attachment.orientation }}">
     
    773768                                </div>
    774769                        </div>
    775770                        <div class="actions">
    776                                 <# if ( data.defaultAttachment && data.defaultAttachment.id !== data.attachment.id ) { #>
     771                                <# if ( data.defaultAttachment ) { #>
    777772                                        <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>
    780773                                <# } #>
     774                                <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
    781775                                <button type="button" class="button upload-button" id="{{ data.settings.default }}-button"><?php echo $this->button_labels['change']; ?></button>
    782776                                <div style="clear:both"></div>
    783777                        </div>
     
    11771171                return $this->manager->widgets->is_widget_rendered( $this->widget_id );
    11781172        }
    11791173}
    1180