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.
Built from https://develop.svn.wordpress.org/trunk@44907


git-svn-id: http://core.svn.wordpress.org/trunk@44738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2019-03-15 16:42:54 +00:00
parent 35b558a3a0
commit b26621d336
2 changed files with 2 additions and 2 deletions

View File

@ -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',
);

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-alpha-44906';
$wp_version = '5.2-alpha-44907';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.