wpseek.com
WordPress开发者和主题制作者的搜索引擎
is_random_header_image › WordPress Function
Since3.2.0
已弃用n/a
› is_random_header_image ( $type = 'any' )
参数: |
|
返回: |
|
定义在: |
|
文档: |
Checks 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().Related Functions: get_random_header_image, has_header_image, _get_random_header_data, header_image, get_header_image
源码
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 || ( empty( $header_image_mod ) && '' !== get_random_header_image() ) ) { 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; }