Skip to:
Content

bbPress.org

Changeset 7193


Ignore:
Timestamp:
04/26/2021 01:30:21 PM (7 months ago)
Author:
johnjamesjacoby
Message:

Akismet: Remove "publish" status restriction in check_post().

This commit ensures that posts of any status are sent to Akismet, even if they had previously been published and are now being edited. The intent of this change is to remove a restriction without changing the behavior from a user's perspective.

Also fixes a typo and an incorrectly typed return value.

Props procifer, douglsmith.

In trunk for 2.7.0. See #3410.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/akismet.php

    r7156 r7193  
    8989        $user_data = array();
    9090        $post_permalink = '';
    91 
    92         // Post is not published
    93         if ( bbp_get_public_status_id() !== $post_data['post_status'] ) {
    94             return $post_data;
    95         }
    9691
    9792        // Cast the post_author to 0 if it's empty
     
    200195     * necessary. For example, switch the status to `spam` if spammy.
    201196     *
    202      * Note: this method also skiis responsible for allowing users who can moderate, to
     197     * Note: this method also is responsible for allowing users who can moderate to
    203198     * never have their posts marked as spam. This is because they are "trusted"
    204199     * users. However, their posts are still sent to Akismet to be checked.
     
    775770        // Bail if the response is an error
    776771        if ( is_wp_error( $response ) ) {
    777             return '';
     772            return array( '', '' );
    778773        }
    779774
Note: See TracChangeset for help on using the changeset viewer.