[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/customize/ -> class-wp-customize-header-image-setting.php (summary)

Customize API: WP_Customize_Header_Image_Setting class

File Size: 235 lines (7 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 1 file
 wp-admin/includes/class-custom-image-header.php

Defines 3 functions

  update()
  sanitize()
  sanitize_choice()

Functions
Functions that are not part of a class:

update( $value )   X-Ref

param: mixed $value The value to update.
return: true Always returns true.

sanitize( $value )   X-Ref
Sanitizes a header value.

The value is expected to be one of the following:

- An array of header image data, with the keys `attachment_id`, `url`, `thumbnail_url`, `timestamp`, `width`,
`height`, `alt_text`, and `attachment_parent`, as supplied by {@see get_uploaded_header_images()}. Any other
key is discarded.
- An array with a `choice` key, being the legacy format in which any of the other accepted values is nested.
- The string `remove-header`, `random-default-image`, or `random-uploaded-image`.
- A string corresponding to one of the keys for the array returned by {@see get_uploaded_header_images()}, or
one of the keys for the array passed into {@see register_default_headers()}.

param: mixed $value Value to sanitize.
return: array|string|WP_Error|null Sanitized value, or `null`/`WP_Error` if invalid. The array holds

sanitize_choice( $value )   X-Ref
Sanitizes a header image choice.

This is the value which is ultimately passed to {@see Custom_Image_Header::set_header_image()}, whether
supplied at the top level of the setting value or nested under its legacy `choice` key.

param: mixed $value Value to sanitize.
return: array|string|WP_Error|null Sanitized value, or `null`/`WP_Error` if invalid.



Generated : Thu Oct 1 08:20:30 2026 Cross-referenced by PHPXref