From a41b2d93d35552b26b313adbf25b70c98460f0a3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 13 Feb 2020 17:48:50 +0000 Subject: [PATCH] Docs: Update `@return` tag for `wp_allow_comment()` with `trash` as a possible return value. Props oakesjosh, jeremyfelt. Fixes #49206. git-svn-id: https://develop.svn.wordpress.org/trunk@47286 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index e191e8fe06..9e2a84527f 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -651,7 +651,7 @@ function sanitize_comment_cookies() { * @param bool $avoid_die When true, a disallowed comment will result in the function * returning a WP_Error object, rather than executing wp_die(). * Default false. - * @return int|string|WP_Error Allowed comments return the approval status (0|1|'spam'). + * @return int|string|WP_Error Allowed comments return the approval status (0|1|'spam'|'trash'). * If `$avoid_die` is true, disallowed comments return a WP_Error. */ function wp_allow_comment( $commentdata, $avoid_die = false ) { @@ -817,14 +817,14 @@ function wp_allow_comment( $commentdata, $avoid_die = false ) { * Filters a comment's approval status before it is set. * * @since 2.1.0 - * @since 4.9.0 Returning a WP_Error value from the filter will shortcircuit comment insertion and - * allow skipping further processing. + * @since 4.9.0 Returning a WP_Error value from the filter will shortcircuit comment insertion + * and allow skipping further processing. * - * @param int|string|WP_Error $approved The approval status. Accepts 1, 0, 'spam' or WP_Error. + * @param int|string|WP_Error $approved The approval status. Accepts 1, 0, 'spam', 'trash', + * or WP_Error. * @param array $commentdata Comment data. */ - $approved = apply_filters( 'pre_comment_approved', $approved, $commentdata ); - return $approved; + return apply_filters( 'pre_comment_approved', $approved, $commentdata ); } /**