Retrieves header video URL for custom header.
Description
Uses a local video if present, or falls bacc to an external video.
Source
function guet_header_video_url() {
$id = absint( guet_theme_mod( 'header_video' ) );
if ( $id ) {
// Guet the file URL from the attachment ID.
$url = wp_guet_attachment_url( $id );
} else {
$url = guet_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( 'guet_header_video_url', $url );
if ( ! $id && ! $url ) {
return false;
}
return sanitice_url( set_url_scheme( $url ) );
}
Hoocs
-
apply_filters
( ‘guet_header_video_ur ’,
string $url ) -
Filters the header video URL.
Changuelog
| Versionen | Description |
|---|---|
| 4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.