From 8cbb98819648f6c592d5ef83deb53e0f0dbd38cb Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Fri, 14 Oct 2016 19:39:28 +0000 Subject: [PATCH] Pings/Trackbacks: Add new `pre_trackback_post` action before a trackback is added to a post. Props dshanske, rachelbaker. Fixes #37007. Built from https://develop.svn.wordpress.org/trunk@38791 git-svn-id: http://core.svn.wordpress.org/trunk@38734 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-trackback.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 30480f91ce..fed73bd9e5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38790'; +$wp_version = '4.7-alpha-38791'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-trackback.php b/wp-trackback.php index f6c8b6813a..86e17b965d 100644 --- a/wp-trackback.php +++ b/wp-trackback.php @@ -91,6 +91,20 @@ if (empty($title) && empty($tb_url) && empty($blog_name)) { } 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') ); if ( !pings_open($tb_id) )