Pings/Trackbacks: Add new pre_trackback_post action before a trackback is added to a post.

Props dshanske, rachelbaker.
Fixes #37007.

git-svn-id: https://develop.svn.wordpress.org/trunk@38791 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Rachel Baker 2016-10-14 19:38:17 +00:00
parent a94f468051
commit 53753c6c3a

View File

@ -91,6 +91,20 @@ if (empty($title) && empty($tb_url) && empty($blog_name)) {
} }
if ( !empty($tb_url) && !empty($title) ) { if ( !empty($tb_url) && !empty($title) ) {
/**
* Fires before the trackback is added to a post.
*
* @since 4.7.0
*
* @param int $tb_id Post ID related to the trackback.
* @param string $tb_url Trackback URL.
* @param string $charset Character Set.
* @param string $title Trackback Title.
* @param string $excerpt Trackback Excerpt.
* @param string $blog_name Blog Name.
*/
do_action( 'pre_trackback_post', $tb_id, $tb_url, $charset, $title, $excerpt, $blog_name );
header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); header('Content-Type: text/xml; charset=' . get_option('blog_charset') );
if ( !pings_open($tb_id) ) if ( !pings_open($tb_id) )