From 0adb5f14aa09448ee61c88acd74d0db9c83de716 Mon Sep 17 00:00:00 2001 From: "Drew Jaynes (DrewAPicture)" Date: Tue, 23 Sep 2014 18:46:52 +0000 Subject: [PATCH] Improve documentation in the `check_comments()` docblock. * Removes two duplicate sentences from the long description * Tightens up phrasing elsewhere in the long description for specific checks * Clarifies the parameter and return descriptions, and adds periods See #29734. git-svn-id: https://develop.svn.wordpress.org/trunk@29762 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 38 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index a4cc7e2b2c..c7f98d124c 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -7,36 +7,34 @@ */ /** - * Checks whether a comment passes internal checks to be allowed to add. + * Check whether a comment passes internal checks to be allowed to add. * - * If comment moderation is set in the administration, then all comments, - * regardless of their type and whitelist will be set to false. If the number of - * links exceeds the amount in the administration, then the check fails. If any - * of the parameter contents match the blacklist of words, then the check fails. + * If manual comment moderation is set in the administration, then all checks, + * regardless of their type and whitelist, will fail and the function will + * return false. * * If the number of links exceeds the amount in the administration, then the * check fails. If any of the parameter contents match the blacklist of words, * then the check fails. * - * If the comment author was approved before, then the comment is - * automatically whitelisted. + * If the comment author was approved before, then the comment is automatically + * whitelisted. * - * If none of the checks fail, then the failback is to set the check to pass - * (return true). + * If all checks pass, the function will return true. * * @since 1.2.0 - * @uses $wpdb * - * @param string $author Comment Author's name - * @param string $email Comment Author's email - * @param string $url Comment Author's URL - * @param string $comment Comment contents - * @param string $user_ip Comment Author's IP address - * @param string $user_agent Comment Author's User Agent - * @param string $comment_type Comment type, either user submitted comment, - * trackback, or pingback - * @return bool Whether the checks passed (true) and the comments should be - * displayed or set to moderated + * @global wpdb $wpdb WordPress database access abstraction object. + * + * @param string $author Comment author name. + * @param string $email Comment author email. + * @param string $url Comment author URL. + * @param string $comment Content of the comment. + * @param string $user_ip Comment author IP address. + * @param string $user_agent Comment author User-Agent. + * @param string $comment_type Comment type, either user-submitted comment, + * trackback, or pingback. + * @return bool If all checks pass, true, otherwise false. */ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) { global $wpdb;