wpseek.com
WordPress开发者和主题制作者的搜索引擎
get_header_image › WordPress Function
Since2.1.0
已弃用n/a
› get_header_image ( 没有参数 )
返回: |
|
定义在: |
|
文档: |
Retrieves header image for custom header.
Related Functions: get_header_image_tag, header_image, get_random_header_image, has_header_image, the_header_image_tag
源码
function get_header_image() { $url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); if ( 'remove-header' === $url ) { return false; } if ( is_random_header_image() ) { $url = get_random_header_image(); } /** * Filters the header image URL. * * @since 6.1.0 * * @param string $url Header image URL. */ $url = apply_filters( 'get_header_image', $url ); if ( ! is_string( $url ) ) { return false; } $url = trim( $url ); return sanitize_url( set_url_scheme( $url ) ); }