A WordPress-centric search engine for devs and theme authors



_custom_logo_header_styles ›

Since4.5.0
Deprecatedn/a
_custom_logo_header_styles ( No parameters )
Access:
  • private
Defined at:
Codex:

Adds CSS to hide header text for custom logo, based on Customizer setting.



Source

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 );

		?>
		<!-- Custom Logo: hide header text -->
		<style id="custom-logo-css" type="text/css">
			<?php echo $classes; ?> {
				position: absolute;
				clip: rect(1px, 1px, 1px, 1px);
			}
		</style>
	<?php
	}
}