WordPress开发者和主题制作者的搜索引擎



add_custom_background ›

Since3.0.0
已弃用3.4.0
add_custom_background ( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' )
参数: (3)
  • (callable) $wp_head_callback Call on the {@see 'wp_head'} action.
    Required: No
    默认: (empty)
  • (callable) $admin_head_callback Call on custom background administration screen.
    Required: No
    默认: (empty)
  • (callable) $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional.
    Required: No
    默认: (empty)
查看:
定义在:
文档:

Add callbacks for background image display.



源码

function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
	_deprecated_function( __FUNCTION__, '3.4.0', 'add_theme_support( \'custom-background\', $args )' );
	$args = array();
	if ( $wp_head_callback )
		$args['wp-head-callback'] = $wp_head_callback;
	if ( $admin_head_callback )
		$args['admin-head-callback'] = $admin_head_callback;
	if ( $admin_preview_callback )
		$args['admin-preview-callback'] = $admin_preview_callback;
	return add_theme_support( 'custom-background', $args );
}