add_custom_background

Add callbacks for background image display.

Description

add_custom_background( (string) $wp_head_callback = '', (string) $admin_head_callback = '', (string) $admin_preview_callback = '' ); 

Parameters (3)

0. $wp_head_callback — Optional. (string) => ''
Call on wp_head action.
1. $admin_head_callback — Optional. (string) => ''
Call on custom background administration screen.
2. $admin_preview_callback — Optional. (string) => ''
Output a custom background image div on the custom background administration screen. Optional.

Usage

  1. if ( !function_exists( 'add_custom_background' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // Call on 'wp_head' action. 
  5. $wp_head_callback = ''; 
  6.  
  7. // Call on custom background administration screen. 
  8. $admin_head_callback = ''; 
  9.  
  10. // Output a custom background image div on the custom background administration screen. Optional. 
  11. $admin_preview_callback = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = add_custom_background($wp_head_callback, $admin_head_callback, $admin_preview_callback); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) { 
  2. _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' ); 
  3. $args = array(); 
  4. if ( $wp_head_callback ) 
  5. $args['wp-head-callback'] = $wp_head_callback; 
  6. if ( $admin_head_callback ) 
  7. $args['admin-head-callback'] = $admin_head_callback; 
  8. if ( $admin_preview_callback ) 
  9. $args['admin-preview-callback'] = $admin_preview_callback; 
  10. return add_theme_support( 'custom-background', $args );