get_header_video_url
函数
get_header_video_url ( No parameters )
- 返回值
-
- (string|false) Header video URL or false if there is no video.
- 定义位置
-
-
wp-includes/theme.php
, line 1583
-
wp-includes/theme.php
- 引入
- 4.7.0
- 弃用
- –
检索自定义页眉的页眉视频URL。
如果有的话,使用本地视频,或者返回到一个外部视频。
function get_header_video_url() { $id = absint( get_theme_mod( 'header_video' ) ); if ( $id ) { // Get the file URL from the attachment ID. $url = wp_get_attachment_url( $id ); } else { $url = get_theme_mod( 'external_header_video' ); } /** * Filters the header video URL. * * @since 4.7.3 * * @param string $url Header video URL, if available. */ $url = apply_filters( 'get_header_video_url', $url ); if ( ! $id && ! $url ) { return false; } return sanitize_url( set_url_scheme( $url ) ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。