get_site_option

函式
get_site_option ( $option, $default = false, $deprecated = true )
引數
  • (string) $option Name of the option to retrieve. Expected to not be SQL-escaped.
    Required:
  • (mixed) $default Optional. Value to return if the option doesn't exist. Default false.
    Required:
    Default: false
  • (bool) $deprecated Whether to use cache. Multisite only. Always set to true.
    Required:
    Default: true
返回值
  • (mixed) Value set for the option.
相關
  • get_network_option()
定義位置
相關方法
get_user_optiondelete_site_optionadd_site_optionget_optionupdate_site_option
引入
2.8.0
棄用
-

get_site_option: 該函式為一個站點檢索一個特定的選項值。它需要兩個引數:選項的名稱和網站的ID。它返回選項值。

根據選項的名稱,檢索當前網路的選項值。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_site_option( $option, $default = false, $deprecated = true ) {
return get_network_option( null, $option, $default );
}
function get_site_option( $option, $default = false, $deprecated = true ) { return get_network_option( null, $option, $default ); }
function get_site_option( $option, $default = false, $deprecated = true ) {
	return get_network_option( null, $option, $default );
}

常見問題

FAQs
檢視更多 >