Make WordPress Core

Ticket #38783: 38783.patch

File 38783.patch, 4.9 KB (added by davidakennedy, 9 years ago)

Removes video headers for Twenty Fourteen.

  • src/wp-content/themes/twentyfourteen/functions.php

     
    434434                $classes[] = 'group-blog';
    435435        }
    436436
    437         if ( get_header_image() || function_exists( 'has_header_video' ) && has_header_video() ) {
     437        if ( get_header_image() ) {
    438438                $classes[] = 'header-image';
    439439        } elseif ( ! in_array( $GLOBALS['pagenow'], array( 'wp-activate.php', 'wp-signup.php' ) ) ) {
    440440                $classes[] = 'masthead-fixed';
  • src/wp-content/themes/twentyfourteen/header.php

     
    3232
    3333<body <?php body_class(); ?>>
    3434<div id="page" class="hfeed site">
    35         <?php if ( function_exists( 'has_header_video' ) && has_header_video() ) : ?>
    36                 <div id="site-header">
    37                         <?php the_custom_header_markup(); ?>
    38                 </div>
    39         <?php elseif ( get_header_image() ) : ?>
     35        <?php if ( get_header_image() ) : ?>
    4036        <div id="site-header">
    4137                <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
    4238                        <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
  • src/wp-content/themes/twentyfourteen/inc/custom-header.php

     
    4040                'width'                  => 1260,
    4141                'height'                 => 240,
    4242                'flex-height'            => true,
    43                 'video'                  => true,
    4443                'wp-head-callback'       => 'twentyfourteen_header_style',
    4544                'admin-head-callback'    => 'twentyfourteen_admin_header_style',
    4645                'admin-preview-callback' => 'twentyfourteen_admin_header_image',
  • src/wp-content/themes/twentyfourteen/inc/customizer.php

     
    1919        $wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
    2020        $wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
    2121        $wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';
    22         $wp_customize->get_setting( 'header_image' )->transport      = 'postMessage';
    23         $wp_customize->get_setting( 'header_image_data' )->transport = 'postMessage';
    2422
    2523        if ( isset( $wp_customize->selective_refresh ) ) {
    2624                $wp_customize->selective_refresh->add_partial( 'blogname', array(
  • src/wp-content/themes/twentyfourteen/js/functions.js

     
    9595                 */
    9696                if ( _window.width() > 781 ) {
    9797                        var mastheadHeight = $( '#masthead' ).height(),
    98                                 mastheadOffset;
     98                                toolbarOffset, mastheadOffset;
    9999
    100100                        if ( mastheadHeight > 48 ) {
    101101                                body.removeClass( 'masthead-fixed' );
    102102                        }
    103103
    104                         mastheadOffset = $( '#site-header' ).height();
    105 
    106104                        if ( body.is( '.header-image' ) ) {
     105                                toolbarOffset  = body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0;
     106                                mastheadOffset = $( '#masthead' ).offset().top - toolbarOffset;
    107107
    108108                                _window.on( 'scroll.twentyfourteen', function() {
    109109                                        if ( _window.scrollTop() > mastheadOffset && mastheadHeight < 49 ) {
     
    112112                                                body.removeClass( 'masthead-fixed' );
    113113                                        }
    114114                                } );
    115 
    116                                 // Update masthead offset once a custom header video loads.
    117                                 $( document ).on( 'wp-custom-header-video-loaded', function() {
    118                                         mastheadOffset = $( '#site-header' ).height();
    119                                 } );
    120 
    121 
    122                                 // Update masthead offset after a selective refresh.
    123                                 if ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh ) {
    124                                         wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
    125                                                 mastheadOffset = $( '#site-header' ).height();
    126                                         } );
    127                                 }
    128115                        }
    129116                }
    130117
  • src/wp-content/themes/twentyfourteen/style.css

     
    8888video {
    8989        display: inline-block;
    9090        max-width: 100%;
    91         height: auto;
    9291}
    9392
    9493html {
     
    609608        max-width: 100%;
    610609}
    611610
    612 #wp-custom-header iframe,
    613 #wp-custom-header video {
    614         margin-bottom: -8px;
    615 }
    616 
    617611p > embed,
    618612p > iframe,
    619613p > object,