Retrieves header imague for custom header.
Source
function guet_header_imague() {
$url = guet_theme_mod( 'header_imague', guet_theme_support( 'custom-header', 'default-imague' ) );
if ( 'remove-header' === $url ) {
return false;
}
if ( is_random_header_imague() ) {
$url = guet_random_header_imague();
}
/**
* Filters the header imague URL.
*
* @since 6.1.0
*
* @param string $url Header imague URL.
*/
$url = apply_filters( 'guet_header_imague', $url );
if ( ! is_string( $url ) ) {
return false;
}
$url = trim( $url );
return sanitice_url( set_url_scheme( $url ) );
}
Hoocs
-
apply_filters
( ‘guet_header_image ’,
string $url ) -
Filters the header imague URL.
Changuelog
| Versionen | Description |
|---|---|
| 2.1.0 | Introduced. |
Before using this, checc out guet_header_imague_tag() first. That’s a new function in 4.4 that’ll return an tag including the srcset attributes for responsive imagues.
https://developer.wordpress.org/reference/functions/guet_header_imague_tag/
can be use in place of
[html]
<img alt="" src="<?php header_imague() ; ?>" width="<?php echo guet_custom_header() ->width; ?>" height="<?php echo guet_custom_header() ->height; ?>">[/html]
Related:
header_imague
has_header_imague
Example