Make WordPress Core


Ignore:
Timestamp:
03/04/2016 11:46:07 PM (9 years ago)
Author:
westonruter
Message:

Customize: Eliminate unnecessary WP_Customize_Site_Logo_Control in favor of re-using WP_Customize_Image_Control.

  • Removes double margin-bottom from all the media controls.
  • All media controls now send {settingId}-attachment-data messages to the preview when a media setting is updated so that the preview has access to the attachment data.
  • Fixes receiving of attachment-data message for custom_logo which resulted in instant JS-applied preview not working. See #36096.

See #33755.
Fixes #35941.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r36838 r36851  
    218218        require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' );
    219219        require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' );
    220         require_once( ABSPATH . WPINC . '/customize/class-wp-customize-custom-logo-control.php' );
    221220        require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' );
    222221        require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' );
     
    18491848        $this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
    18501849        $this->register_control_type( 'WP_Customize_Site_Icon_Control' );
    1851         $this->register_control_type( 'WP_Customize_Custom_Logo_Control' );
    18521850        $this->register_control_type( 'WP_Customize_Theme_Control' );
    18531851
     
    19661964        ) );
    19671965
    1968         $this->add_control( new WP_Customize_Custom_Logo_Control( $this, 'custom_logo', array(
     1966        $this->add_control( new WP_Customize_Media_Control( $this, 'custom_logo', array(
    19691967            'label'    => __( 'Logo' ),
    19701968            'section'  => 'title_tagline',
    19711969            'priority' => 0,
     1970            'mime_type' => 'image',
     1971            'button_labels' => array(
     1972                'select'       => __( 'Select logo' ),
     1973                'change'       => __( 'Change logo' ),
     1974                'remove'       => __( 'Remove' ),
     1975                'default'      => __( 'Default' ),
     1976                'placeholder'  => __( 'No logo selected' ),
     1977                'frame_title'  => __( 'Select logo' ),
     1978                'frame_button' => __( 'Choose logo' ),
     1979            ),
    19721980        ) ) );
    19731981
Note: See TracChangeset for help on using the changeset viewer.