BuddyDev

Search

[Resolved] error

  • Participant
    Level: Guru
    Posts: 703
    Tosin on #46053

    Hello,

    while using the bp rewrites plugin at https://wordpress.org/plugins/bp-rewrites/ im getting the debug error while using this code

     function buddydev_reorder_buddypress_profile_tabs() {
    	$bp  = buddypress();
    	$nav = $bp->members->nav;
    
    	// it's a map of nav items for user profile to their position.
    	$nav_items = array(
    		'activity' => 10,
    		'my-blog' => 20,
    		'adverts'  => 30,
    		'profile'   => 40,
    		'following'    => 50,
    		'followers' => 60,
    		'messages'  => 70,
    		'notifications'  => 80,
    		'orders'  => 90,
    		'contact-me' => 100,
    		'settings'  => 110,
    	);
    
    	foreach ( $nav_items as $nav_item => $position ) {
    		$nav->edit_nav( array( 'position' => $position ), $nav_item );
    	}
    }
    add_action( 'bp_setup_nav', 'buddydev_reorder_buddypress_profile_tabs', 999 ); 

    This is the debug error

     [14-Aug-2022 22:45:01 UTC] PHP Fatal error:  Uncaught Error: Call to undefined method BP\Rewrites\Core_Nav_Compat::edit_nav() in /var/www/wptbox/wp-content/plugins/bp-custom.php:699
    Stack trace:
    #0 /var/www/wptbox/wp-includes/class-wp-hook.php(307): buddydev_reorder_buddypress_profile_tabs()
    
    [14-Aug-2022 22:45:04 UTC] PHP Notice:  Function bp_displayed_user_id() was called <strong>incorrectly</strong>. Please wait for the <code>bp_parse_query</code> hook to be fired before using it. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version BP Rewrites.) in /var/www/wptbox/wp-includes/functions.php on line 5831
    
    [14-Aug-2022 22:45:48 UTC] PHP Notice:  Function BuddyPress Members Nav was called <strong>incorrectly</strong>. Please wait for the <code>bp_setup_nav</code> hook to be fired before trying to create a nav or a subnav item. The following nav item slugs are problematic: <strong style="color: red">cover-photo, my-blog, posts, create, published, drafts</strong>. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version BP Rewrites.) in /var/www/wptbox/wp-includes/functions.php on line 5831 
  • Keymaster
    (BuddyDev Team)
    Posts: 21861
    Brajesh Singh on #46059

    Hi Tosin,
    Please report it to BuddyPress team/trac.

    They will have better idea as the plugin is still in beta for the rewrite.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved