Make WordPress Core

Ticket #5224: 5224.patch

File 5224.patch, 1.0 KB (added by Viper007Bond, 17 years ago)

Remove self-pings via a filter (literal copy/paste of the plugin)

  • wp-includes/comment.php

     
    752752}
    753753
    754754
     755// Don't self-ping by Michael D. Adams
     756function no_self_ping( &$links ) {
     757        $home = get_option( 'home' );
     758        foreach ( $links as $l => $link )
     759                if ( 0 === strpos( $link, $home ) )
     760                        unset($links[$l]);
     761}
     762
     763
    755764function privacy_ping_filter($sites) {
    756765        if ( '0' != get_option('blog_public') )
    757766                return $sites;
  • wp-includes/default-filters.php

     
    133133add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3);
    134134add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
    135135add_filter('comment_email', 'antispambot');
     136add_filter('pre_ping', 'no_self_ping');
    136137
    137138// Actions
    138139add_action('wp_head', 'rsd_link');