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主题中增加对自定义头像的支持: 该函数接收一个定义头像属性的参数数组。

增加图片标题显示的回调。

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
查看更多 >