Title: WP_Customize_Header_Image_Setting::update
Published: April 25, 2014
Last modified: February 24, 2026

---

# WP_Customize_Header_Image_Setting::update( mixed $value )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#wp--skip-link--target)

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#parameters)󠁿

 `$value`mixedrequired

The value to update.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#source)󠁿

    ```php
    public function update( $value ) {
    	global $custom_image_header;

    	// If _custom_header_background_just_in_time() fails to initialize $custom_image_header when not is_admin().
    	if ( empty( $custom_image_header ) ) {
    		require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
    		$args                   = get_theme_support( 'custom-header' );
    		$admin_head_callback    = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;
    		$admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null;
    		$custom_image_header    = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
    	}

    	/*
    	 * If the value doesn't exist (removed or random),
    	 * use the header_image value.
    	 */
    	if ( ! $value ) {
    		$value = $this->manager->get_setting( 'header_image' )->post_value();
    	}

    	if ( is_array( $value ) && isset( $value['choice'] ) ) {
    		$custom_image_header->set_header_image( $value['choice'] );
    	} else {
    		$custom_image_header->set_header_image( $value );
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-header-image-setting.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/customize/class-wp-customize-header-image-setting.php#L36)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/customize/class-wp-customize-header-image-setting.php#L36-L61)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#related)󠁿

| Uses | Description | 
| [Custom_Image_Header::set_header_image()](https://developer.wordpress.org/reference/classes/custom_image_header/set_header_image/)`wp-admin/includes/class-custom-image-header.php` |

Chooses a header image, selected from existing uploaded and default headers, or provides an array of uploaded header data (either new, or from media library).

  | 
| [Custom_Image_Header::__construct()](https://developer.wordpress.org/reference/classes/custom_image_header/__construct/)`wp-admin/includes/class-custom-image-header.php` |

Constructor – Registers administration header callback.

  | 
| [get_theme_support()](https://developer.wordpress.org/reference/functions/get_theme_support/)`wp-includes/theme.php` |

Gets the theme support arguments passed when registering that support.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_header_image_setting/update/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_header_image_setting%2Fupdate%2F)
before being able to contribute a note or feedback.