get_uploaded_header_images(): array  Gets the header images uploaded for the active theme.   Return array    Source  File: wp-includes/theme.php. View all references  function get_uploaded_header_images() {
	$header_images = array();

	// @todo Caching.
	$headers = get_posts(
		array(
			'post_type'  => 'attachment',
			'meta_key'   => '_wp_attachment_is_custom_header',
			'meta_value' => get_option( 'stylesheet' ),
			'orderby'    => 'none',
			'nopaging'   => true,
		)
	);

	if ( empty( $headers ) ) {
		return array();
	}

	foreach ( (array) $headers as $header ) {
		$url          = sanitize_url( wp_get_attachment_url( $header->ID ) );
		$header_data  = wp_get_attachment_metadata( $header->ID );
		$header_index = $header->ID;

		$header_images[ $header_index ]                  = array();
		$header_images[ $header_index ]['attachment_id'] = $header->ID;
		$header_images[ $header_index ]['url']           = $url;
		$header_images[ $header_index ]['thumbnail_url'] = $url;
		$header_images[ $header_index ]['alt_text']      = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );

		if ( isset( $header_data['attachment_parent'] ) ) {
			$header_images[ $header_index ]['attachment_parent'] = $header_data['attachment_parent'];
		} else {
			$header_images[ $header_index ]['attachment_parent'] = '';
		}

		if ( isset( $header_data['width'] ) ) {
			$header_images[ $header_index ]['width'] = $header_data['width'];
		}
		if ( isset( $header_data['height'] ) ) {
			$header_images[ $header_index ]['height'] = $header_data['height'];
		}
	}

	return $header_images;
}
   Related  Uses    Uses Description      sanitize_url() wp-includes/formatting.php   Sanitizes a URL for database or redirect usage.     wp_get_attachment_url() wp-includes/post.php   Retrieves the URL for an attachment.     wp_get_attachment_metadata() wp-includes/post.php   Retrieves attachment metadata for attachment ID.     get_posts() wp-includes/post.php   Retrieves an array of the latest posts, or posts matching the given criteria.     get_option() wp-includes/option.php   Retrieves an option value based on an option name.     get_post_meta() wp-includes/post.php   Retrieves a post meta field for the given post ID.   
   Used By    Used By Description      get_media_states() wp-admin/includes/template.php   Retrieves an array of media states from an attachment.     Custom_Image_Header8b7c:f320:99b9:690f:4595:cd17:293a:c069get_uploaded_header_images() wp-admin/includes/class-custom-image-header.php   Gets the previously uploaded header images.     Custom_Image_Header8b7c:f320:99b9:690f:4595:cd17:293a:c069step_1() wp-admin/includes/class-custom-image-header.php   Display first step of custom header image page.     Custom_Image_Header8b7c:f320:99b9:690f:4595:cd17:293a:c069set_header_image() wp-admin/includes/class-custom-image-header.php   Choose a header image, selected from existing uploaded and default headers, or provide an array of uploaded header data (either new, or from media library).     Custom_Image_Header8b7c:f320:99b9:690f:4595:cd17:293a:c069show_header_selector() wp-admin/includes/class-custom-image-header.php   Display UI for selecting one of several default headers.     _get_random_header_data() wp-includes/theme.php   Gets random header image data from registered images in theme.   
    Changelog    Version Description     3.2.0 Introduced.    

    
{'path': 'public/docs/wordpress/functions/get_uploaded_header_images.html', 'source': 'DevDocs.IO'}