Make WordPress Core


Ignore:
Timestamp:
03/03/2016 07:55:15 PM (9 years ago)
Author:
obenland
Message:

Customize: Site logos are custom logos.

Brings the nomenclature closer to custom headers and backgrounds.

See https://wordpress.slack.com/archives/core/p1456955151003150
See #35945.

File:
1 edited

Legend:

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

    r36796 r36837  
    18491849        $this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
    18501850        $this->register_control_type( 'WP_Customize_Site_Icon_Control' );
    1851         $this->register_control_type( 'WP_Customize_Site_Logo_Control' );
     1851        $this->register_control_type( 'WP_Customize_Custom_Logo_Control' );
    18521852        $this->register_control_type( 'WP_Customize_Theme_Control' );
    18531853
     
    19611961        ) ) );
    19621962
    1963         $this->add_setting( 'site_logo', array(
    1964             'theme_supports' => array( 'site-logo' ),
     1963        $this->add_setting( 'custom_logo', array(
     1964            'theme_supports' => array( 'custom-logo' ),
    19651965            'transport'      => 'postMessage',
    19661966        ) );
    19671967
    1968         $this->add_control( new WP_Customize_Site_Logo_Control( $this, 'site_logo', array(
     1968        $this->add_control( new WP_Customize_Custom_Logo_Control( $this, 'custom_logo', array(
    19691969            'label'    => __( 'Logo' ),
    19701970            'section'  => 'title_tagline',
     
    19731973
    19741974        if ( isset( $this->selective_refresh ) ) {
    1975             $this->selective_refresh->add_partial( 'site_logo', array(
    1976                 'settings'            => array( 'site_logo' ),
    1977                 'selector'            => '.site-logo-link',
    1978                 'render_callback'     => array( $this, '_render_site_logo_partial' ),
     1975            $this->selective_refresh->add_partial( 'custom_logo', array(
     1976                'settings'            => array( 'custom_logo' ),
     1977                'selector'            => '.custom-logo-link',
     1978                'render_callback'     => array( $this, '_render_custom_logo_partial' ),
    19791979                'container_inclusive' => true,
    19801980            ) );
     
    22122212
    22132213    /**
    2214      * Callback for rendering the site logo, used in the site_logo partial.
     2214     * Callback for rendering the custom logo, used in the custom_logo partial.
    22152215     *
    22162216     * This method exists because the partial object and context data are passed
    2217      * into a partial's render_callback so we cannot use get_the_site_logo() as
     2217     * into a partial's render_callback so we cannot use get_custom_logo() as
    22182218     * the render_callback directly since it expects a blog ID as the first
    22192219     * argument. When WP no longer supports PHP 5.3, this method can be removed
     
    22252225     * @access private
    22262226     *
    2227      * @return string Site logo.
    2228      */
    2229     public function _render_site_logo_partial() {
    2230         return get_the_site_logo();
     2227     * @return string Custom logo.
     2228     */
     2229    public function _render_custom_logo_partial() {
     2230        return get_custom_logo();
    22312231    }
    22322232}
Note: See TracChangeset for help on using the changeset viewer.