diff options
author | Yury German <blueknight@gentoo.org> | 2019-04-28 17:39:03 -0400 |
---|---|---|
committer | Yury German <blueknight@gentoo.org> | 2019-04-28 17:39:03 -0400 |
commit | 2ab16973706e120bc344c83be6295b54fd908c57 (patch) | |
tree | 358267a52d9542c77c90e3663cea32d13b8cb639 /plugins/jetpack/modules/sitemaps/sitemap-builder.php | |
parent | Update twentysixteen 1.7 (diff) | |
download | blogs-gentoo-2ab16973706e120bc344c83be6295b54fd908c57.tar.gz blogs-gentoo-2ab16973706e120bc344c83be6295b54fd908c57.tar.bz2 blogs-gentoo-2ab16973706e120bc344c83be6295b54fd908c57.zip |
Updating packages for 5.1.1
Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/sitemaps/sitemap-builder.php')
-rw-r--r-- | plugins/jetpack/modules/sitemaps/sitemap-builder.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/sitemaps/sitemap-builder.php b/plugins/jetpack/modules/sitemaps/sitemap-builder.php index c74b1f03..e04f58d5 100644 --- a/plugins/jetpack/modules/sitemaps/sitemap-builder.php +++ b/plugins/jetpack/modules/sitemaps/sitemap-builder.php @@ -1319,6 +1319,20 @@ class Jetpack_Sitemap_Builder { /** This filter is already documented in core/wp-includes/feed.php */ $content = apply_filters( 'the_content_feed', $content, 'rss2' ); + + // Include thumbnails for VideoPress videos, use blank image for others + if ( 'complete' === get_post_meta( $post->ID, 'videopress_status', true ) && has_post_thumbnail( $post ) ) { + $video_thumbnail_url = get_the_post_thumbnail_url( $post ); + } else { + /** + * Filter the thumbnail image used in the video sitemap for non-VideoPress videos. + * + * @since 7.2.0 + * + * @param string $str Image URL. + */ + $video_thumbnail_url = apply_filters( 'jetpack_video_sitemap_default_thumbnail', 'https://s0.wp.com/i/blank.jpg' ); + } $item_array = array( 'url' => array( @@ -1327,7 +1341,7 @@ class Jetpack_Sitemap_Builder { 'video:video' => array( /** This filter is already documented in core/wp-includes/feed.php */ 'video:title' => apply_filters( 'the_title_rss', $post->post_title ), - 'video:thumbnail_loc' => '', + 'video:thumbnail_loc' => esc_url( $video_thumbnail_url ), 'video:description' => $content, 'video:content_loc' => esc_url( wp_get_attachment_url( $post->ID ) ), ), |