register_default_headers

函式
register_default_headers ( $headers )
引數
  • (array) $headers Array of headers keyed by a string ID. The IDs point to arrays containing 'url', 'thumbnail_url', and 'description' keys.
    Required:
定義位置
相關方法
unregister_default_headersregister_column_headersregister_sidebarsfilter_default_metadatarest_api_default_filters
引入
3.0.0
棄用
-

register_default_headers: 這個函式用來為一個主題註冊預設的頭像。它需要一個引數:$headers。$headers是一個頭像陣列,包括圖片的URL、寬度、高度和描述。

註冊選定的預設頭像,以便由自定義頭像管理介面顯示。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function register_default_headers( $headers ) {
global $_wp_default_headers;
$_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers );
}
function register_default_headers( $headers ) { global $_wp_default_headers; $_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers ); }
function register_default_headers( $headers ) {
	global $_wp_default_headers;

	$_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers );
}

常見問題

FAQs
檢視更多 >