wppaste
WordPress

Custom_Image_Header

Since
2.1.0
Source
wp-admin/includes/class-custom-image-header.php:14
The custom header image class.

Compatibility

WordPress
since 2.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 6

Every hook that fires from inside Custom_Image_Header, in the order it appears in the class, grouped by the method that fires it.

Properties · 4

$admin_header_callbackcallablepublic
Callback for administration header.
$admin_image_div_callbackcallablepublic
Callback for header div.
$default_headersarraypublic
Holds default headers.
$updatedboolprivate
Used to trigger a success message when settings updated and set to true.

Methods · 33

Source code

#[AllowDynamicProperties]class Custom_Image_Header { 	/**	 * Callback for administration header.	 *	 * @since 2.1.0	 * @var callable	 */	public $admin_header_callback; 	/**	 * Callback for header div.	 *	 * @since 3.0.0	 * @var callable	 */	public $admin_image_div_callback; 	/**	 * Holds default headers.	 *	 * @since 3.0.0	 * @var array	 */	public $default_headers = array(); 	/**	 * Used to trigger a success message when settings updated and set to true.	 *	 * @since 3.0.0	 * @var bool	 */	private $updated; 	/**	 * Constructor - Registers administration header callback.	 *	 * @since 2.1.0	 *	 * @param callable $admin_header_callback    Administration header callback.	 * @param callable $admin_image_div_callback Optional. Custom image div output callback.	 *                                           Default empty string.	 */	public function __construct( $admin_header_callback, $admin_image_div_callback = '' ) {		$this->admin_header_callback    = $admin_header_callback;		$this->admin_image_div_callback = $admin_image_div_callback; 		add_action( 'admin_menu', array( $this, 'init' ) ); 		add_action( 'customize_save_after', array( $this, 'customize_set_last_used' ) );		add_action( 'wp_ajax_custom-header-crop', array( $this, 'ajax_header_crop' ) );		add_action( 'wp_ajax_custom-header-add', array( $this, 'ajax_header_add' ) );		add_action( 'wp_ajax_custom-header-remove', array( $this, 'ajax_header_remove' ) );	} 	/**	 * Sets up the hooks for the Custom Header admin page.	 *	 * @since 2.1.0	 */	public function init() {		$page = add_theme_page(			_x( 'Header', 'custom image header' ),			_x( 'Header', 'custom image header' ),			'edit_theme_options',			'custom-header',			array( $this, 'admin_page' )		); 		if ( ! $page ) {			return;		} 		add_action( "admin_print_scripts-{$page}", array( $this, 'js_includes' ) );		add_action( "admin_print_styles-{$page}", array( $this, 'css_includes' ) );		add_action( "admin_head-{$page}", array( $this, 'help' ) );		add_action( "admin_head-{$page}", array( $this, 'take_action' ), 50 );		add_action( "admin_head-{$page}", array( $this, 'js' ), 50 );

Changelog

Introduced in 2.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-admin/includes/class-custom-image-header.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.