wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_enqueue_admin_bar_bump_styles › WordPress Function

Seit6.4.0
Veraltetn/v
wp_enqueue_admin_bar_bump_styles ( Keine Parameter )
Definiert in:
Codex:

Enqueues inline bump styles to make room for the admin bar.



Quellcode

function wp_enqueue_admin_bar_bump_styles() {
	if ( current_theme_supports( 'admin-bar' ) ) {
		$admin_bar_args  = get_theme_support( 'admin-bar' );
		$header_callback = $admin_bar_args[0]['callback'];
	}

	if ( empty( $header_callback ) ) {
		$header_callback = '_admin_bar_bump_cb';
	}

	if ( '_admin_bar_bump_cb' !== $header_callback ) {
		return;
	}

	// Back-compat for plugins that disable functionality by unhooking this action.
	if ( ! has_action( 'wp_head', $header_callback ) ) {
		return;
	}
	remove_action( 'wp_head', $header_callback );

	$css = '
		@media screen { html { margin-top: 32px !important; } }
		@media screen and ( max-width: 782px ) { html { margin-top: 46px !important; } }
	';
	wp_add_inline_style( 'admin-bar', $css );
}