Last active
January 19, 2017 22:50
-
-
Save danemorgan/33fc144793bee923c2311b585e3515bb to your computer and use it in GitHub Desktop.
Checking for custom options in WordPress Customizer. Don't use HEADER_TEXTCOLOR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Do it this way instead | |
***********************************************/ | |
/* | |
* If no custom options for text are set, let's bail. | |
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ). | |
*/ | |
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { | |
return; | |
} | |
// If we get this far, we have custom styles. Let's do this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is the wron way to check because the HEADER_TEXTCOLOR constant is deprecated. | |
***********************************************/ | |
/* | |
* If no custom options for text are set, let's bail. | |
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: HEADER_TEXTCOLOR. | |
*/ | |
if ( HEADER_TEXTCOLOR === $header_text_color ) { | |
return; | |
} | |
// If we get this far, we have custom styles. Let's do this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment