WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#26815 closed enhancement (maybelater)

Add theme_mod to disable Header Text as default

Reported by: grapplerulrich Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Customize Keywords: needs-patch
Focuses: Cc:

Description

There is no way to disable the header text as default.

A trick would be to do something like this but then there is no default color.

function custom_header_setup() {
        add_theme_support( 'custom-header', array(
                'default-text-color' => 'blank',
        ) );
        set_theme_mod( $name, $value );
}
add_action( 'after_setup_theme', 'custom_header_setup' );`

I think this would follow up from https://core.trac.wordpress.org/ticket/18887

My idea would be

function display_header_text() {
        if ( ! current_theme_supports( 'custom-header', 'header-text' ) )
                return false;

        $header_text = get_theme_mod( 'header_text', get_theme_support( 'custom-header', 'display-header-text' ) );
        return $header_text;
}

Files that would need to be updated.
https://github.com/WordPress/WordPress/blob/master/wp-admin/custom-header.php#L609
https://github.com/WordPress/WordPress/blob/master/wp-includes/theme.php#L991
https://github.com/WordPress/WordPress/blob/master/wp-includes/theme.php#L1407

Change History (5)

#1 @nacin
7 years ago

  • Component changed from Themes to Appearance

This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.


6 years ago

#3 @celloexpressions
6 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Let's see what a patch looks like here, keeping the Customizer in mind.

This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.


4 years ago

#5 @melchoyce
4 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from new to closed

Closing per above convo in Slack

Note: See TracTickets for help on using tickets.