From 18a251d06540f25a4e6a131405caf943d6759267 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 15 Mar 2019 16:41:53 +0000 Subject: [PATCH] Embeds: Allow post title to be filtered when preparing an oEmbed response. By changing the way the post title is added to the array of data from `$post->post_title` to `get_the_title()`, the title can now be modified using the `the_title` filter. This ensures post titles returned in oEmbed responses are consistent with those that show on a site. Props mheikkila, swissspidy. Fixes #42826. git-svn-id: https://develop.svn.wordpress.org/trunk@44907 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/embed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index 7cce664548..24edbca1e0 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -539,7 +539,7 @@ function get_oembed_response_data( $post, $width ) { 'provider_url' => get_home_url(), 'author_name' => get_bloginfo( 'name' ), 'author_url' => get_home_url(), - 'title' => $post->post_title, + 'title' => get_the_title( $post ), 'type' => 'link', );