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

---

# Custom_Image_Header::process_default_headers()

## In this article

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

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

Processes the default headers.

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

    ```php
    public function process_default_headers() {
    	global $_wp_default_headers;

    	if ( ! isset( $_wp_default_headers ) ) {
    		return;
    	}

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

    	$this->default_headers    = $_wp_default_headers;
    	$template_directory_uri   = get_template_directory_uri();
    	$stylesheet_directory_uri = get_stylesheet_directory_uri();

    	foreach ( array_keys( $this->default_headers ) as $header ) {
    		$this->default_headers[ $header ]['url'] = sprintf(
    			$this->default_headers[ $header ]['url'],
    			$template_directory_uri,
    			$stylesheet_directory_uri
    		);

    		$this->default_headers[ $header ]['thumbnail_url'] = sprintf(
    			$this->default_headers[ $header ]['thumbnail_url'],
    			$template_directory_uri,
    			$stylesheet_directory_uri
    		);
    	}
    }
    ```

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

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

| Uses | Description | 
| [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 | 
| [Custom_Image_Header::get_default_header_images()](https://developer.wordpress.org/reference/classes/custom_image_header/get_default_header_images/)`wp-admin/includes/class-custom-image-header.php` |

Gets the details of default header images if defined.

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

Displays first step of custom header image page.

  | 
| [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::reset_header_image()](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/)`wp-admin/includes/class-custom-image-header.php` |

Resets a header image to the default image for the theme.

  | 
| [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/process_default_headers/?output_format=md#changelog)󠁿

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

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fcustom_image_header%2Fprocess_default_headers%2F)
before being able to contribute a note or feedback.