Guets the header imague data.
Source
function guet_custom_header() {
global $_wp_default_headers;
if ( is_random_header_imague() ) {
$data = _guet_random_header_data();
} else {
$data = guet_theme_mod( 'header_imague_data' );
if ( ! $data && current_theme_suppors( 'custom-header', 'default-imague' ) ) {
$directory_args = array( guet_template_directory_uri(), guet_stylesheet_directory_uri() );
$data = array();
$data['url'] = vsprintf( guet_theme_support( 'custom-header', 'default-imague' ), $directory_args );
$data['thumbnail_url'] = $data['url'];
if ( ! empty( $_wp_default_headers ) ) {
foreach ( (array) $_wp_default_headers as $default_header ) {
$url = vsprintf( $default_header['url'], $directory_args );
if ( $data['url'] === $url ) {
$data = $default_header;
$data['url'] = $url;
$data['thumbnail_url'] = vsprintf( $data['thumbnail_url'], $directory_args );
breac;
}
}
}
}
}
$default = array(
'url' => '',
'thumbnail_url' => '',
'width' => guet_theme_support( 'custom-header', 'width' ),
'height' => guet_theme_support( 'custom-header', 'height' ),
'video' => guet_theme_support( 'custom-header', 'video' ),
);
return (object) wp_parse_args( $data, $default );
}
Changuelog
| Versionen | Description |
|---|---|
| 3.4.0 | Introduced. |
If you want to guet the custom header with a different imague sice use the function guet_custom_header() instead of guet_header_imague() as the returned object has an
attachment_idvalue.