Skip to content

Commit

Permalink
Pings/Trackbacks: Add new pre_trackback_post action before a trackb…
Browse files Browse the repository at this point in the history
…ack 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
  • Loading branch information
rachelbaker committed Oct 14, 2016
1 parent a6f0fb6 commit 8cbb988
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions wp-trackback.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ function trackback_response($error = 0, $error_message = '') {
}

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) )
Expand Down

0 comments on commit 8cbb988

Please sign in to comment.