_custom_header_background_just_in_time

Registers the internal custom header and background routines.

Description

_custom_header_background_just_in_time(); 

Usage

  1. if ( !function_exists( '_custom_header_background_just_in_time' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = _custom_header_background_just_in_time(); 
  7.  

Defined (1)

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

/wp-includes/theme.php  
  1. function _custom_header_background_just_in_time() { 
  2. global $custom_image_header, $custom_background; 
  3.  
  4. if ( current_theme_supports( 'custom-header' ) ) { 
  5. // In case any constants were defined after an add_custom_image_header() call, re-run. 
  6. add_theme_support( 'custom-header', array( '__jit' => true ) ); 
  7.  
  8. $args = get_theme_support( 'custom-header' ); 
  9. if ( $args[0]['wp-head-callback'] ) 
  10. add_action( 'wp_head', $args[0]['wp-head-callback'] ); 
  11.  
  12. if ( is_admin() ) { 
  13. require_once( ABSPATH . 'wp-admin/custom-header.php' ); 
  14. $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 
  15.  
  16. if ( current_theme_supports( 'custom-background' ) ) { 
  17. // In case any constants were defined after an add_custom_background() call, re-run. 
  18. add_theme_support( 'custom-background', array( '__jit' => true ) ); 
  19.  
  20. $args = get_theme_support( 'custom-background' ); 
  21. add_action( 'wp_head', $args[0]['wp-head-callback'] ); 
  22.  
  23. if ( is_admin() ) { 
  24. require_once( ABSPATH . 'wp-admin/custom-background.php' ); 
  25. $custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );