Skip to content

Instantly share code, notes, and snippets.

@fangcat
Created August 16, 2014 09:08
Show Gist options
  • Save fangcat/6923d1afd2fb4a552648 to your computer and use it in GitHub Desktop.
Save fangcat/6923d1afd2fb4a552648 to your computer and use it in GitHub Desktop.
關閉Pingback給自己
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