Created
January 17, 2012 22:35
-
-
Save glueckpress/1629455 to your computer and use it in GitHub Desktop.
Disable self trackbacks from your own WordPress blog.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Retrieved from: http://wp-snippets.com/disable-self-trackbacks/ | |
add_action( 'pre_ping', 'disable_self_ping' ); | |
function disable_self_ping( &$links ) { | |
foreach ( $links as $l => $link ) | |
if ( 0 === strpos( $link, get_option( 'home' ) ) ) | |
unset($links[$l]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment