Make WordPress Core


Ignore:
Timestamp:
02/28/2010 08:02:14 PM (14 years ago)
Author:
nacin
Message:

Provide filter to allow including comment author's URL in comment moderation link count. see #11684

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r13434 r13513  
    4646        return false; // If moderation is set to manual
    4747
    48     if ( get_option( 'comment_max_links' ) && preg_match_all( '/<a [^>]*href/i', apply_filters( 'comment_text', $comment ), $out) >= get_option( 'comment_max_links' ) )
    49         return false; // Check # of external links
     48    // Check # of external links
     49    if ( $max_links = get_option( 'comment_max_links' ) ) {
     50        $num_links = preg_match_all( '/<a [^>]*href/i', apply_filters( 'comment_text', $comment ), $out );
     51        $num_links = apply_filters( 'comment_max_links_url', $num_links, $url ); // provide for counting of $url as a link
     52        if ( $num_links >= $max_links )
     53            return false;
     54    }
    5055
    5156    $mod_keys = trim(get_option('moderation_keys'));
Note: See TracChangeset for help on using the changeset viewer.