On this page
_custom_logo_header_styles()
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Adds CSS to hide header text for custom logo, based on Customizer setting.
Source
File: wp-includes/theme.php. View all references
function _custom_logo_header_styles() {
if ( ! current_theme_supports( 'custom-header', 'header-text' )
&& get_theme_support( 'custom-logo', 'header-text' )
&& ! get_theme_mod( 'header_text', true )
) {
$classes = (array) get_theme_support( 'custom-logo', 'header-text' );
$classes = array_map( 'sanitize_html_class', $classes );
$classes = '.' . implode( ', .', $classes );
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
?>
<!-- Custom Logo: hide header text -->
<style id="custom-logo-css"<?php echo $type_attr; ?>>
<?php echo $classes; ?> {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
}
</style>
<?php
}
}
Related
Uses
| Uses | Description |
|---|---|
| get_theme_mod() wp-includes/theme.php | Retrieves theme modification value for the active theme. |
| get_theme_support() wp-includes/theme.php | Gets the theme support arguments passed when registering that support. |
| current_theme_supports() wp-includes/theme.php | Checks a theme’s support for a given feature. |
Changelog
| Version | Description |
|---|---|
| 4.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_custom_logo_header_styles