add_custom_image_header

函式
add_custom_image_header ( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' )
引數
  • (callable) $wp_head_callback Call on the {@see 'wp_head'} action.
    Required:
  • (callable) $admin_head_callback Call on custom header administration screen.
    Required:
  • (callable) $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
    Required:
    Default: (empty)
相關
  • add_theme_support()
定義位置
相關方法
remove_custom_image_headerhas_custom_headerget_custom_header_custom_logo_header_stylesadd_custom_background
引入
2.1.0
棄用
3.4.0

add_custom_image_header: 這個函式在WordPress主題中增加對自定義頭像的支援: 該函式接收一個定義頭像屬性的引數陣列。

增加圖片標題顯示的回撥。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
_deprecated_function( __FUNCTION__, '3.4.0', 'add_theme_support( 'custom-header', $args )' );
$args = array(
'wp-head-callback' => $wp_head_callback,
'admin-head-callback' => $admin_head_callback,
);
if ( $admin_preview_callback )
$args['admin-preview-callback'] = $admin_preview_callback;
return add_theme_support( 'custom-header', $args );
}
function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) { _deprecated_function( __FUNCTION__, '3.4.0', 'add_theme_support( 'custom-header', $args )' ); $args = array( 'wp-head-callback' => $wp_head_callback, 'admin-head-callback' => $admin_head_callback, ); if ( $admin_preview_callback ) $args['admin-preview-callback'] = $admin_preview_callback; return add_theme_support( 'custom-header', $args ); }
function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
	_deprecated_function( __FUNCTION__, '3.4.0', 'add_theme_support( 'custom-header', $args )' );
	$args = array(
		'wp-head-callback'    => $wp_head_callback,
		'admin-head-callback' => $admin_head_callback,
	);
	if ( $admin_preview_callback )
		$args['admin-preview-callback'] = $admin_preview_callback;
	return add_theme_support( 'custom-header', $args );
}

常見問題

FAQs
檢視更多 >