Title: WP_Customize_Header_Image_Control::print_header_image_template
Published: April 25, 2014
Last modified: May 20, 2026

---

# WP_Customize_Header_Image_Control::print_header_image_template()

## In this article

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

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

Prints header image template.

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

    ```php
    public function print_header_image_template() {
    	?>
    	<script type="text/template" id="tmpl-header-choice">
    		<# if (data.random) { #>
    		<button type="button" class="button display-options random">
    			<span class="dashicons dashicons-randomize dice"></span>
    			<# if ( data.type === 'uploaded' ) { #>
    				<?php _e( 'Randomize uploaded headers' ); ?>
    			<# } else if ( data.type === 'default' ) { #>
    				<?php _e( 'Randomize suggested headers' ); ?>
    			<# } #>
    		</button>

    		<# } else { #>

    		<button type="button" class="choice thumbnail"
    			data-customize-image-value="{{data.header.url}}"
    			data-customize-header-image-data="{{JSON.stringify(data.header)}}">
    			<span class="screen-reader-text">
    				<?php
    				/* translators: Hidden accessibility text. */
    				_e( 'Set image' );
    				?>
    			</span>
    			<img src="{{data.header.thumbnail_url}}" alt="{{data.header.alt_text || data.header.description}}" />
    		</button>

    		<# if ( data.type === 'uploaded' ) { #>
    			<button type="button" class="dashicons dashicons-no close">
    				<span class="screen-reader-text">
    					<?php
    					/* translators: Hidden accessibility text. */
    					_e( 'Remove image' );
    					?>
    				</span>
    			</button>
    		<# } #>

    		<# } #>
    	</script>

    	<script type="text/template" id="tmpl-header-current">
    		<# if (data.choice) { #>
    			<# if (data.random) { #>

    		<div class="placeholder">
    			<span class="dashicons dashicons-randomize dice"></span>
    			<# if ( data.type === 'uploaded' ) { #>
    				<?php _e( 'Randomizing uploaded headers' ); ?>
    			<# } else if ( data.type === 'default' ) { #>
    				<?php _e( 'Randomizing suggested headers' ); ?>
    			<# } #>
    		</div>

    			<# } else { #>

    		<img src="{{data.header.thumbnail_url}}" alt="{{data.header.alt_text || data.header.description}}" />

    			<# } #>
    		<# } #>
    	</script>
    	<?php
    }
    ```

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

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

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

Displays translated text.

  |

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