Created
August 16, 2014 09:08
-
-
Save fangcat/6923d1afd2fb4a552648 to your computer and use it in GitHub Desktop.
關閉Pingback給自己
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
function prohibit_self_pingback( &$links ) { | |
$home = get_option( 'home' ); | |
foreach ( $links as $l => $link ) | |
if ( 0 === strpos( $link, $home ) ) unset($links[$l]); | |
} | |
add_action( 'pre_ping', 'prohibit_self_pingback' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment