add_screen_option

函式
add_screen_option ( $option, $args = array() )
引數
  • (string) $option An option name.
    Required:
  • (mixed) $args Option-dependent arguments.
    Required:
    Default: array()
定義位置
相關方法
screen_optionsadd_site_optionset_screen_optionsadd_optionscreen_icon
引入
3.1.0
棄用
-

add_screen_option: 這個函式用來在WordPress管理螢幕上新增一個新的螢幕選項。螢幕選項允許你自定義WordPress管理螢幕上各種元素的顯示。你可以使用這個函式在螢幕選項選單中新增新的選項。

註冊和配置一個管理螢幕選項。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function add_screen_option( $option, $args = array() ) {
$current_screen = get_current_screen();
if ( ! $current_screen ) {
return;
}
$current_screen->add_option( $option, $args );
}
function add_screen_option( $option, $args = array() ) { $current_screen = get_current_screen(); if ( ! $current_screen ) { return; } $current_screen->add_option( $option, $args ); }
function add_screen_option( $option, $args = array() ) {
	$current_screen = get_current_screen();

	if ( ! $current_screen ) {
		return;
	}

	$current_screen->add_option( $option, $args );
}

常見問題

FAQs
檢視更多 >