Пример #1
0
 /**
  * @ticket 38738
  */
 function test_video_header_callback_globally_with_negative_filter()
 {
     $this->_add_theme_support(array('video' => true, 'video-active-callback' => '__return_true'));
     $this->go_to(get_permalink(self::$post));
     add_filter('is_header_video_active', '__return_false');
     $result = is_header_video_active();
     remove_filter('is_header_video_active', '__return_false');
     $this->assertFalse($result);
 }
Пример #2
0
/**
 * Print the markup for a custom header.
 *
 * A container div will always be printed in the Customizer preview.
 *
 * @since 4.7.0
 */
function the_custom_header_markup()
{
    $custom_header = get_custom_header_markup();
    if (empty($custom_header)) {
        return;
    }
    echo $custom_header;
    if (is_header_video_active() && (has_header_video() || is_customize_preview())) {
        wp_enqueue_script('wp-custom-header');
        wp_localize_script('wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings());
    }
}