is_random_header_image [ WordPress Function ]
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Check if random header image is in use.
Always true if user expressly chooses the option in Appearance > Header. Also true if theme has multiple header images registered, no specific header image is chosen, and theme turns on random headers with add_theme_support().
Source
<?php
function is_random_header_image( $type = 'any' ) {
$header_image_mod = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
if ( 'any' == $type ) {
if ( 'random-default-image' == $header_image_mod || 'random-uploaded-image' == $header_image_mod || ( '' != get_random_header_image() && empty( $header_image_mod ) ) )
return true;
} else {
if ( "random-$type-image" == $header_image_mod )
return true;
elseif ( 'default' == $type && empty( $header_image_mod ) && '' != get_random_header_image() )
return true;
}
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- is_random_header_image:WordPress私的マニュアル
2011年11月2日 ... is_random_header_image - テーマがランダムヘッダイメージに対応しているか 調べる.
elearn.jp - PHPXRef 0.7 : WordPress : Detail view of theme.php
is_random_header_image() header_image() get_uploaded_header_images() get_custom_header() register_default_headers() unregister_default_headers() ...
phpxref.ftwr.co.uk - #17240 (Themes: Add ability to show a random header image ...
17240-fix-default-is_random_header_image.diff · Download (667 bytes) - added by kawauso 13 months ago. Allow for $type 'default' when no header is chosen ...
core.trac.wordpress.org - get_custom_header (WordPress Function) - WPSeek.com
$data = is_random_header_image()? _get_random_header_data() : get_theme_mod( 'header_image_data' ); $default = array( 'url' => '', ' thumbnail_url' => '', ...
wpseek.com