Skip to:
Content

bbPress.org

Changeset 6113


Ignore:
Timestamp:
11/02/2016 09:49:10 AM (8 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.
Fixes #2987.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/functions.php

    r6056 r6113  
    22452245
    22462246        // Get any existing meta queries
    2247         $meta_query   = $posts_query->get( 'meta_query' );
     2247        $meta_query   = $posts_query->get( 'meta_query', array() );
    22482248
    22492249        // Add our meta query to existing
Note: See TracChangeset for help on using the changeset viewer.