wp_admin_bar_header

函式
wp_admin_bar_header ( No parameters )

wp_admin_bar_header: 這個函式用於在WordPress管理欄的頭部新增內容: 該函式需要一個引數:$wp_admin_bar。$wp_admin_bar是WordPress管理欄的例項,內容應該被新增到該例項中。

為管理欄列印樣式和指令碼。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_admin_bar_header() {
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
?>
<style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style>
<?php
}
function wp_admin_bar_header() { $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; ?> <style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style> <?php }
function wp_admin_bar_header() {
	$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
	?>
<style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style>
	<?php
}

常見問題

FAQs
檢視更多 >