Title: Custom_Image_Header::get_uploaded_header_images
Published: April 25, 2014
Last modified: May 20, 2026

---

# Custom_Image_Header::get_uploaded_header_images(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/custom_image_header/get_uploaded_header_images/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/custom_image_header/get_uploaded_header_images/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/custom_image_header/get_uploaded_header_images/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/custom_image_header/get_uploaded_header_images/?output_format=md#changelog)

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

Gets the previously uploaded header images.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/custom_image_header/get_uploaded_header_images/?output_format=md#return)󠁿

 array Uploaded header images.

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

    ```php
    public function get_uploaded_header_images() {
    	$header_images = get_uploaded_header_images();
    	$timestamp_key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
    	$alt_text_key  = '_wp_attachment_image_alt';

    	foreach ( $header_images as &$header_image ) {
    		$header_meta               = get_post_meta( $header_image['attachment_id'] );
    		$header_image['timestamp'] = $header_meta[ $timestamp_key ] ?? '';
    		$header_image['alt_text']  = $header_meta[ $alt_text_key ] ?? '';
    	}

    	return $header_images;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-custom-image-header.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-custom-image-header.php#L1580)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-custom-image-header.php#L1580-L1592)

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

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

Gets the header images uploaded for the active theme.

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

Retrieves name of the current stylesheet.

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

Retrieves a post meta field for the given post ID.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/custom_image_header/get_uploaded_header_images/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/custom_image_header/get_uploaded_header_images/?output_format=md#)

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

Gets the ID of a previous crop from the same base image.

  | 
| [WP_Customize_Header_Image_Control::prepare_control()](https://developer.wordpress.org/reference/classes/wp_customize_header_image_control/prepare_control/)`wp-includes/customize/class-wp-customize-header-image-control.php` |

Prepares the control.

  |

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

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

## User Contributed Notes

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