WordPress.org

Make WordPress Core

Ticket #38390: 38390.diff

File 38390.diff, 1.7 KB (added by joemcgill, 5 years ago)
  • src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php

    diff --git src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php
    index 4b64427..19c79ac 100644
     
    4141
    4242        <?php
    4343                $content = apply_filters( 'the_content', get_the_content() );
    44                 $audio = get_media_embedded_in_content( $content, array( 'audio' ) );
     44                $audio = false;
     45
     46                // Only get audio from the content if a playlist isn't present.
     47                if ( false === strpos( $content, 'wp-playlist-script' ) ) {
     48                        $audio = get_media_embedded_in_content( $content, array( 'audio' ) );
     49                }
     50
    4551        ?>
    4652
    4753        <?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>
  • src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php

    diff --git src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php
    index 95abee4..cfa3755 100644
     
    4040
    4141        <?php
    4242                $content = apply_filters( 'the_content', get_the_content() );
    43                 $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
     43                $video = false;
     44
     45                // Only get video from the content if a playlist isn't present.
     46                if ( false === strpos( $content, 'wp-playlist-script' ) ) {
     47                        $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
     48                }
    4449        ?>
    4550
    4651        <?php if ( '' !== get_the_post_thumbnail() && ! is_single() && empty( $video ) ) : ?>