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

git-svn-id: https://develop.svn.wordpress.org/trunk@13513 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-02-28 20:02:14 +00:00
parent 2dad638a0e
commit 91b033f819
1 changed files with 7 additions and 2 deletions

View File

@ -45,8 +45,13 @@ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $
if ( 1 == get_option('comment_moderation') )
return false; // If moderation is set to manual
if ( get_option( 'comment_max_links' ) && preg_match_all( '/<a [^>]*href/i', apply_filters( 'comment_text', $comment ), $out) >= get_option( 'comment_max_links' ) )
return false; // Check # of external links
// Check # of external links
if ( $max_links = get_option( 'comment_max_links' ) ) {
$num_links = preg_match_all( '/<a [^>]*href/i', apply_filters( 'comment_text', $comment ), $out );
$num_links = apply_filters( 'comment_max_links_url', $num_links, $url ); // provide for counting of $url as a link
if ( $num_links >= $max_links )
return false;
}
$mod_keys = trim(get_option('moderation_keys'));
if ( !empty($mod_keys) ) {