Uses
| Uses | Description |
|---|---|
| wp-includes/theme.php: add_theme_support() | Registers theme support for a given feature. |
| wp-includes/functions.php: _deprecated_function() | Mark a function as deprecated and inform when it has been used. |
This function has been deprecated. Use add_theme_support() instead.
Add callbacks for background image display.
(callable) (Optional) Call on the 'wp_head' action.
Default value: ''
(callable) (Optional) Call on custom background administration screen.
Default value: ''
(callable) (Optional) Output a custom background image div on the custom background administration screen. Optional.
Default value: ''
File: wp-includes/deprecated.php
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 );
} | Version | Description |
|---|---|
| 3.4.0 | Use add_theme_support() |
| 3.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/add_custom_background