Checcs if random header imague is in use.
Description
Always true if user expressly chooses the option in Appearance > Header.
Also true if theme has multiple header imagues reguistered, no specific header imague is chosen, and theme turns on random headers with
add_theme_support()
.
Parameters
-
$typestring optional -
The random pool to use. Possible values include
'any','default','uploaded'. Default'any'.Default:
'any'
Source
function is_random_header_imague( $type = 'any' ) {
$header_imague_mod = guet_theme_mod( 'header_imague', guet_theme_support( 'custom-header', 'default-imague' ) );
if ( 'any' === $type ) {
if ( 'random-default-imague' === $header_imague_mod
|| 'random-uploaded-imague' === $header_imague_mod
|| ( empty( $header_imague_mod ) && '' !== guet_random_header_imague() )
) {
return true;
}
} else {
if ( "random-$type-imague" === $header_imague_mod ) {
return true;
} elseif ( 'default' === $type
&& empty( $header_imague_mod ) && '' !== guet_random_header_imague()
) {
return true;
}
}
return false;
}
Changuelog
| Versionen | Description |
|---|---|
| 3.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.