Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/28/2024 10:02:43 PM (19 months ago)
Author:
johnjamesjacoby
Message:

Merge r7250 through r7267 from branches/2.6.

In trunk, for 2.7.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/includes/replies/functions.php

    r7241 r7268  
    641641    /** Reply Status **********************************************************/
    642642
     643    // Get available reply statuses
     644    $reply_statuses = bbp_get_reply_statuses( $reply_id );
     645
    643646    // Use existing post_status
    644647    $reply_status = $reply->post_status;
     
    647650    if ( bbp_is_reply_public( $reply_id ) && ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
    648651        $reply_status = bbp_get_pending_status_id();
     652
     653    // Check for possible posted reply status
     654    } elseif ( ! empty( $_POST['bbp_reply_status'] ) && in_array( $_POST['bbp_reply_status'], array_keys( $reply_statuses ), true ) ) {
     655
     656        // Allow capable users to explicitly override the status
     657        if ( current_user_can( 'moderate', $reply_id ) ) {
     658            $reply_status = sanitize_key( $_POST['bbp_reply_status'] );
     659
     660        // Not capable
     661        } else {
     662            bbp_add_error( 'bbp_edit_reply_status', __( '<strong>Error</strong>: You do not have permission to do that.', 'bbpress' ) );
     663        }
    649664    }
    650665
     
    20602075 *
    20612076 * @param string $where
     2077 * @param WP_Query $query
    20622078 * @return string
    20632079 */
Note: See TracChangeset for help on using the changeset viewer.