mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@29029 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2642,6 +2642,11 @@ function edit_form_image_editor( $post ) {
|
||||
$attr['height'] = $h;
|
||||
}
|
||||
|
||||
$thumb_id = get_post_thumbnail_id( $attachment_id );
|
||||
if ( ! empty( $thumb_id ) ) {
|
||||
$attr['poster'] = wp_get_attachment_url( $thumb_id );
|
||||
}
|
||||
|
||||
echo wp_video_shortcode( $attr );
|
||||
|
||||
endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user