Make WordPress Core

Changeset 44907


Ignore:
Timestamp:
03/15/2019 04:41:53 PM (6 years ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/embed.php

    r44155 r44907  
    540540        'author_name'   => get_bloginfo( 'name' ),
    541541        'author_url'    => get_home_url(),
    542         'title'         => $post->post_title,
     542        'title'         => get_the_title( $post ),
    543543        'type'          => 'link',
    544544    );
Note: See TracChangeset for help on using the changeset viewer.