wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_enqueue_admin_bar_header_styles › WordPress Function

Since6.4.0
Deprecatedn/a
wp_enqueue_admin_bar_header_styles ( No parameters )
Defined at:
Codex:

Enqueues inline style to hide the admin bar when printing.



Source

function wp_enqueue_admin_bar_header_styles() {
	// Back-compat for plugins that disable functionality by unhooking this action.
	$action = is_admin() ? 'admin_head' : 'wp_head';
	if ( ! has_action( $action, 'wp_admin_bar_header' ) ) {
		return;
	}
	remove_action( $action, 'wp_admin_bar_header' );

	wp_add_inline_style( 'admin-bar', '@media print { #wpadminbar { display:none; } }' );
}