Make WordPress Core


Ignore:
Timestamp:
07/08/2014 05:47:53 PM (11 years ago)
Author:
wonderboymusic
Message:

When setting the poster image for a video shortcode, set that image as the featured image for that attachment (if found) in the background. This AJAX functionality could be used for audio as well.

Introduces attachment_url_to_postid() to attempt to turn URLs into post IDs.

Fixes #27891.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r28871 r29029  
    26432643        }
    26442644
     2645        $thumb_id = get_post_thumbnail_id( $attachment_id );
     2646        if ( ! empty( $thumb_id ) ) {
     2647            $attr['poster'] = wp_get_attachment_url( $thumb_id );
     2648        }
     2649
    26452650        echo wp_video_shortcode( $attr );
    26462651
Note: See TracChangeset for help on using the changeset viewer.