Make WordPress Core


Ignore:
Timestamp:
02/11/2020 04:34:09 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Customize: Avoid unnecessary get_theme_mod() call and premature escaping in get_header_video_url().

The result is still escaped with esc_url_raw() for retrieval, and with esc_url() for display in the_header_video_url().

Props dlh, Tkama.
Fixes #40044.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r47219 r47267  
    14281428 */
    14291429function get_header_video_url() {
    1430     $id  = absint( get_theme_mod( 'header_video' ) );
    1431     $url = esc_url( get_theme_mod( 'external_header_video' ) );
     1430    $id = absint( get_theme_mod( 'header_video' ) );
    14321431
    14331432    if ( $id ) {
    14341433        // Get the file URL from the attachment ID.
    14351434        $url = wp_get_attachment_url( $id );
     1435    } else {
     1436        $url = get_theme_mod( 'external_header_video' );
    14361437    }
    14371438
Note: See TracChangeset for help on using the changeset viewer.