Making WordPress.org


Ignore:
Timestamp:
07/03/2017 10:15:17 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Avoid a PHP warning in Moderators::add_post_status_to_query() if $args['post_status'] is an array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php

    r5329 r5616  
    244244    public function add_post_status_to_query( $args = array() ) {
    245245        if ( bbp_get_view_all() ) {
    246             $post_stati = explode( ',', $args['post_status'] );
    247             $post_stati[] = self::ARCHIVED;
    248             $args['post_status'] = implode( ',', $post_stati );
     246            if ( is_array( $args['post_status'] ) ) {
     247                $args['post_status'][] = self::ARCHIVED;
     248            } else {
     249                $post_stati = explode( ',', $args['post_status'] );
     250                $post_stati[] = self::ARCHIVED;
     251                $args['post_status'] = implode( ',', $post_stati );
     252            }
    249253        }
    250254        return $args;
Note: See TracChangeset for help on using the changeset viewer.