Make WordPress Core

Ticket #39512: 39512.2.diff

File 39512.2.diff, 786 bytes (added by celloexpressions, 8 years ago)

Filter get_header_video_url().

  • src/wp-includes/theme.php

     
    13381338        $id = absint( get_theme_mod( 'header_video' ) );
    13391339        $url = esc_url( get_theme_mod( 'external_header_video' ) );
    13401340
    1341         if ( ! $id && ! $url ) {
    1342                 return false;
    1343         }
    1344 
    13451341        if ( $id ) {
    13461342                // Get the file URL from the attachment ID.
    13471343                $url = wp_get_attachment_url( $id );
    13481344        }
    13491345
     1346        /**
     1347         * Modify the header video url.
     1348         *
     1349         * @since 4.7.3
     1350         *
     1351         * @param string $url Header video url, if available.
     1352         */
     1353        $url = apply_filters( 'get_header_video_url', $url );
     1354
     1355        if ( ! $id && ! $url ) {
     1356                return false;
     1357        }
     1358
    13501359        return esc_url_raw( set_url_scheme( $url ) );
    13511360}
    13521361