Filter hook 'get_header_image_tag'

in WP Core File wp-includes/theme.php at line 1360

View Source

get_header_image_tag

Filter Hook
Description
Filters the markup of header images.

Hook Information

File Location wp-includes/theme.php View on GitHub
Hook Type Filter
Line Number 1360

Hook Parameters

Type Name Description
string $html The HTML image tag markup being filtered.
object $header The custom header object returned by 'get_custom_header()'.
array $attr Array of the attributes for the image tag.

Usage Examples

Basic Usage
<?php
// Hook into get_header_image_tag
add_filter('get_header_image_tag', 'my_custom_filter', 10, 3);

function my_custom_filter($html, $header, $attr) {
    // Your custom filtering logic here
    return $html;
}

Source Code Context

wp-includes/theme.php:1360 - How this hook is used in WordPress core
<?php
1355  	 *
1356  	 * @param string $html   The HTML image tag markup being filtered.
1357  	 * @param object $header The custom header object returned by 'get_custom_header()'.
1358  	 * @param array  $attr   Array of the attributes for the image tag.
1359  	 */
1360  	return apply_filters( 'get_header_image_tag', $html, $header, $attr );
1361  }
1362  
1363  /**
1364   * Displays the image markup for a custom header image.
1365   *

PHP Documentation

<?php
/**
	 * Filters the markup of header images.
	 *
	 * @since 4.4.0
	 *
	 * @param string $html   The HTML image tag markup being filtered.
	 * @param object $header The custom header object returned by 'get_custom_header()'.
	 * @param array  $attr   Array of the attributes for the image tag.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/theme.php
Related Hooks

Related hooks will be displayed here in future updates.