Make WordPress Core


Ignore:
Timestamp:
03/09/2016 11:43:49 PM (10 years ago)
Author:
obenland
Message:

Customize: Only add custom logo’s header text control if needed.

Dissolves WP_CustomLogo and adopts a structure similar to custom header and background (See _delete_attachment_theme_mod()).
The option to hide header text only gets added if it’s not already part of custom header, and only if selectors have been registered when theme support for custom logos was declared. Themes can add postMessage support for it as well.

Example:

add_theme_support( 'custom-logo', array(
    'size' => ‘large’,
    'header-text' => array( 'site-title', 'site-description' ),
) );

See #33755.

File:
1 edited

Legend:

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

    r36912 r36915  
    19231923        ) );
    19241924
    1925         // Add a setting to hide header text if the theme isn't supporting the feature itself.
    1926         // @todo
    1927         if ( ! current_theme_supports( 'custom-header' ) ) {
     1925        // Add a setting to hide header text if the theme doesn't support custom headers.
     1926        if ( ! current_theme_supports( 'custom-header', 'header-text' ) ) {
    19281927            $this->add_setting( 'header_text', array(
     1928                'theme_supports'    => array( 'custom-logo', 'header-text' ),
    19291929                'default'           => 1,
    19301930                'sanitize_callback' => 'absint',
    1931                 'transport'         => 'postMessage',
    19321931            ) );
    19331932
Note: See TracChangeset for help on using the changeset viewer.