WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/15/2016 07:15:20 AM (5 years ago)
Author:
peterwilsoncc
Message:

Themes: Remove front page restriction from video header functions.

Adds a callback for determining when video headers should be displayed in themes supporting custom headers. By default, video headers are only displayed on the front page of a site.

Theme authors may set a custom callback by passing 'video-active-callback' => 'mytheme_video_active_callback' as an argument. The default callback is is_front_page().

This introduces the new function is_header_video_active() - returns true on pages that should display video headers. The return value can be filtered using the new filter of the same name.

Props flixos90, bradyvercher, peterwilsoncc, joemcgill.
Fixes #38738.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r39237 r39240  
    34923492                'frame_button' => __( 'Choose Video' ),
    34933493            ),
    3494             'active_callback' => 'is_front_page',
     3494            'active_callback' => 'is_header_video_active',
    34953495        ) ) );
    34963496
Note: See TracChangeset for help on using the changeset viewer.