Title: Custom_Image_Header::get_default_header_images
Published: April 25, 2014
Last modified: April 28, 2025

---

# Custom_Image_Header::get_default_header_images(): array

## In this article

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

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

Gets the details of default header images if defined.

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

 array Default header images.

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

    ```php
    public function get_default_header_images() {
    	$this->process_default_headers();

    	// Get the default image if there is one.
    	$default = get_theme_support( 'custom-header', 'default-image' );

    	if ( ! $default ) { // If not, easy peasy.
    		return $this->default_headers;
    	}

    	$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );

    	$already_has_default = false;

    	foreach ( $this->default_headers as $k => $header ) {
    		if ( $header['url'] === $default ) {
    			$already_has_default = true;
    			break;
    		}
    	}

    	if ( $already_has_default ) {
    		return $this->default_headers;
    	}

    	// If the one true image isn't included in the default set, prepend it.
    	$header_images            = array();
    	$header_images['default'] = array(
    		'url'           => $default,
    		'thumbnail_url' => $default,
    		'description'   => 'Default',
    	);

    	// The rest of the set comes after.
    	return array_merge( $header_images, $this->default_headers );
    }
    ```

[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/6.9.4/src/wp-admin/includes/class-custom-image-header.php#L1536)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-custom-image-header.php#L1536-L1571)

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

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

Processes the default headers.

  | 
| [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.

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

Retrieves template directory URI for the active theme.

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

Retrieves stylesheet directory URI for the active theme.

  |

| Used by | Description | 
| [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` |  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/custom_image_header/get_default_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_default_header_images%2F)
before being able to contribute a note or feedback.