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
This commit is contained in:
Jonathan Desrosiers 2019-03-15 16:41:53 +00:00
parent b66ae2b4c1
commit 18a251d065
1 changed files with 1 additions and 1 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',
);