Make WordPress Core


Ignore:
Timestamp:
11/16/2016 11:37:42 PM (8 years ago)
Author:
joemcgill
Message:

Twenty Seventeen: Add styles for custom header video controls.

Following [39272], this uses the header_video_settings filter to modify
the default video header control markup and adds theme specific styles
for the play/pause button.

Props melchoyce, laurelfulford, joemcgill, davidakennedy, bradyvercher.
Fixes #38697.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/inc/custom-header.php

    r39224 r39273  
    9595}
    9696endif; // End of twentyseventeen_header_style.
     97
     98/**
     99 * Customize video play/pause button in the custom header.
     100 */
     101function twentyseventeen_video_controls( $settings ) {
     102    $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) );
     103    $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) );
     104    return $settings;
     105}
     106add_filter( 'header_video_settings', 'twentyseventeen_video_controls' );
Note: See TracChangeset for help on using the changeset viewer.