Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_nav was called incorrectly


  • polywebjeff
    Participant

    @polywebjeff

    Notice	bp_nav was called incorrectly. These globals should not be used directly and are deprecated. Please use the BuddyPress nav functions instead. Please see Debugging in WordPress for more information. (This message was added in version 2.6.0.)	6	
    +
    wp-includes/functions.php:4667
    Plugin: buddypress
    Notice	bp_nav was called incorrectly. These globals should not be used directly and are deprecated. Please use the BuddyPress nav functions instead. Please see Debugging in WordPress for more information. (This message was added in version 2.6.0.)	5	
    +
    wp-includes/functions.php:4667
    Plugin: buddypress
    Notice	bp_nav was called incorrectly. The bp_nav and bp_options_nav globals should not be used directly and are deprecated. Please use the BuddyPress nav functions instead. Please see Debugging in WordPress for more information. (This message was added in version 2.6.0.)	1	
    +
    wp-includes/functions.php:4667
    Plugin: buddypress

    I get those error with my 4.2.0 version of BP. I’ve got custom bp templates in my child-theme, but none using bp_nav. All of these issues are related to the core files of the buddypress plugin. How can I resolve this issue? Is it normal?

Viewing 3 replies - 1 through 3 (of 3 total)

  • Venutius
    Moderator

    @venutius

    Yep this is one of those unhelpful errors where it points to the code generating the actual error message and not the code causing the issue. Have you tried switching to a default theme to rule out that kind of thing entirely? Last time I had one of these it turned out to be code in my bp-custom.php, which was last on my list of things to check.


    polywebjeff
    Participant

    @polywebjeff

    Switching to the default aarvark theme did indead remove the error messages. I’ve switched back to the child theme, and removed mycode from bp-custom. No results. My BP templates do not contain bp_nav, but I didn’t took the time to change the file versions in the top comments. I have those custom files:

  • aarvark-child/buddypress/members/single/myorganization/edit.php
  • /**
     * BuddyPress - Members Single Profile Edit
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     * @version 3.0.0
     */
  • aarvark-child/buddypress/members/single/myorganization/profile-loop.php
  • /**
     * BuddyPress - Members Profile Loop
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     * @version 3.0.0
     */
  • aarvark-child/buddypress/members/single/myorganization/profile-wp.php
  • /**
     * BuddyPress - Members Single Profile WP
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     * @version 3.0.0
     */
  • aarvark-child/buddypress/members/single/profile/edit.php
  • /**
     * BuddyPress - Members Single Profile Edit
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     * @version 3.0.0
     */
  • aarvark-child/buddypress/members/single/home.php
  • /**
     * BuddyPress - Members Home
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
  • aarvark-child/buddypress/members/single/member-header.php
  • /**
     * BuddyPress - Users Header
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
  • aarvark-child/buddypress/members/register.php
  • no version in comments

    In my functions.php file:

    // New buddypress nav items
    
    function add_bp_menu_items() {
        global $bp;
        //Remove unwanted nav items
        bp_core_remove_nav_item( 'activity' );
        bp_core_remove_nav_item( 'forums' );
        bp_core_remove_nav_item( 'user-media' );
    //    bp_core_remove_subnav_item( 'profile', 'public' );
        unset($bp->bp_options_nav['profile']['public']);
        unset($bp->bp_options_nav['profile']['change-avatar']);
        unset($bp->bp_options_nav['profile']['change-cover-image']);
        unset($bp->bp_options_nav['settings']['profile']);
        unset($bp->bp_options_nav['settings']['data']);
    
        $bp->bp_options_nav['profile']['name'] = 'My Profile';
    }
    add_action( 'bp_setup_nav', 'add_bp_menu_items', 15 );
    
    // Change Profile menu/tab order
    function rt_change_profile_tab_order() {
        global $bp;
    
        $bp->members->nav->edit_nav( array(
            'name' => 'My Profile',
        ), 'profile' );
    
        $bp->members->nav->edit_nav( array(
            'position' => 1,
        ), 'profile' );
    
        $bp->members->nav->edit_nav( array(
            'position' => 65,
        ), 'notifications' );
    }
    add_action( 'bp_init', 'rt_change_profile_tab_order', 999 );

Venutius
Moderator

@venutius

Try removing that code from your functions.php as a start, that’s nav related. This is pretty much the ideal use case for one of my more obscure plugins – https://wordpress.org/plugins/bp-template-overloader

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar