[buddypress-trac] [BuddyPress Trac] #8005: Reset() expects parameter 1 to be and array, boolean given - buddypress/bp-core/bp-core-template.php 3038

buddypress-trac noreply at wordpress.org
Thu Nov 22 10:21:24 UTC 2018


#8005: Reset() expects parameter 1 to be and array, boolean given - buddypress/bp-
core/bp-core-template.php 3038
--------------------------+------------------------------
 Reporter:  Venutius      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Core          |     Version:  3.0.0
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by Venutius):

 My latest fix is to wrap a check to see if the variable is an array:

 {{{
 #!python
 if ( ! empty( $bp->members->nav ) ) {
         $primary_nav_item = $bp->members->nav->get_primary( array( 'slug'
 => $component_id ), false );
         if ( is_array( $primary_nav_item ) ) {
                 $primary_nav_item = reset( $primary_nav_item );
         }
 }
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8005#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list