Skip to:
Content

BuddyPress.org

Changeset 11797


Ignore:
Timestamp:
01/05/2018 01:38:15 PM (3 years ago)
Author:
djpaul
Message:

Templates, Nouveau: fix PHP Notice when secondary navigation is not set.

For example, as a anonymous users with the third-party plugin, "Social Articles".

Fixes #7629

Props hnla

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core-nav.php

    r11447 r11797  
    353353     * @param array $args Filters to select the specific secondary items. See wp_list_filter().
    354354     * @param bool  $sort True to sort the nav items. False otherwise.
    355      * @return array The list of secondary objects nav
     355     * @return bool|array The list of secondary objects nav, or false if none set.
    356356     */
    357357    public function get_secondary( $args = array(), $sort = true ) {
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r11770 r11797  
    756756    }
    757757
     758    // The navigation can be empty.
     759    if ( $nav === false ) {
     760        $nav = array();
     761    }
     762
    758763    $bp_nouveau->sorted_nav = array_values( $nav );
    759764
Note: See TracChangeset for help on using the changeset viewer.