wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_enqueue_admin_bar_bump_styles › WordPress Function

Since6.4.0
已弃用n/a
wp_enqueue_admin_bar_bump_styles ( 没有参数 )
定义在:
文档:

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



源码

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