Skip to:
Content

bbPress.org

Changeset 6417


Ignore:
Timestamp:
05/19/2017 09:33:55 AM (7 years ago)
Author:
netweb
Message:

General: Set the default return to an empty array in $posts_query->get() in bbp_pre_get_posts_normalize_forum_visibility()

This changeset fixes PHP 7.1 warnings [] operator not supported for strings due to WP_Query:get() defaulting to returning an empty string if the requested key isn't set. However, you can pass a default return value. This commit sets the default return to an empty array.

Props thebrandonallen.
See #2987.

Merges [6113] to the 2.5 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/forums/functions.php

    r6020 r6417  
    18491849
    18501850        // Get any existing meta queries
    1851         $meta_query   = $posts_query->get( 'meta_query' );
     1851        $meta_query   = $posts_query->get( 'meta_query', array() );
    18521852
    18531853        // Add our meta query to existing
Note: See TracChangeset for help on using the changeset viewer.