Making WordPress.org

Changeset 6372


Ignore:
Timestamp:
01/12/2018 06:17:26 PM (7 years ago)
Author:
obenland
Message:

WordPress.tv: Enabled HD videos by default.

Props iandunn.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php

    r5015 r6372  
    485485                $attributes = shortcode_parse_atts( $shortcode[0] );
    486486                $image      = video_image_url_by_guid( rtrim( $attributes[1], ']' ), 'fmt_dvd' ); // dvd image has width = 640
    487                 $video      = sprintf( '[%s %s w="605"]', $shortcode[2], trim( $shortcode[3] ) );
     487                $hd_param   = '';
     488
     489                // Only set HD param is it won't already be set from `$shortcode[3]`.
     490                if ( ! array_key_exists( 'hd', $attributes ) ) {
     491                    $hd_param = sprintf( 'hd="%d"', (bool) get_option( 'video_player_high_quality', false ) );
     492                }
     493
     494                $video      = sprintf( '[%s %s w="605" %s]', $shortcode[2], trim( $shortcode[3] ), $hd_param );
    488495                $video      = apply_filters( 'the_content', $video );
    489496            }
Note: See TracChangeset for help on using the changeset viewer.