get_header_image_tag

Filters the markup of header images.

Description

apply_filters( 'get_header_image_tag', (string) $html, (object) $header, (array) $attr ); 

Parameters (3)

0. $html (string)
The HTML image tag markup being filtered.
1. $header (object)
The custom header object returned by get_custom_header()..
2. $attr (array)
Array of the attributes for the image tag.

Usage

To run the hook, copy the example below.
  1. $html = apply_filters( 'get_header_image_tag', $html, $header, $attr ); 
  2.  
  3. if ( !empty( $html ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the get_header_image_tag callback 
  2. function filter_get_header_image_tag( $html, $header, $attr ) { 
  3. // make filter magic happen here... 
  4. return $html
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'get_header_image_tag', 'filter_get_header_image_tag', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'get_header_image_tag', 'filter_get_header_image_tag', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/theme.php  
  1. return apply_filters( 'get_header_image_tag', $html, $header, $attr );