Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change Profile Nav Tab order


  • lynnapp
    Participant

    @lynnapp

    Hi,
    I have tried the following code as referenced elsewhere in the forum but it is not working and I am getting the following message in the console of my local host under debug.

    //Change order of Buddypress tabs
    
    function my_change_profile_tab_order() {
    	global $bp;
    	$bp->bp_nav['media']['position'] = 5;
    	$bp->bp_nav['activity']['position'] = 10;
    	$bp->bp_nav['profile']['position'] = 20;
    	$bp->bp_nav['courses']['position'] = 30;
    	$bp->bp_nav['forums']['position'] = 40;
    	$bp->bp_nav['groups']['position'] = 50;
    	$bp->bp_nav['friends']['position'] = 60;
    	$bp->bp_nav['notifications']['position'] = 70;
    	$bp->bp_nav['messages']['position'] = 80;
    }
    add_action( 'bp_setup_nav', 'my_change_profile_tab_order', 999 );

    This is the message in the console, I think something has changed in the updates?

    [Warning] Object (query-monitor.js, line 379)
    component: "Plugin: buddypress"
    
    file: "wp-includes/functions.php"
    
    key: "69b475930fd0a3e41f19cfbe3b59ca70"
    
    line: 5663
    
    message: "bp_nav was called incorrectly. The bp_nav and bp_options_nav globals should not be used directly and are deprecated. Please use th…"
    
    stack: Array (7)
    	0 "BP_Core_BP_Nav_BackCompat->offsetGet()"
    	1 "my_change_profile_tab_order()"
    	2 "do_action('bp_setup_nav')"
    	3 "bp_setup_nav()"
    	4 "do_action('bp_init')"
    	5 "bp_init()"
    	6 "do_action('init')"
    	Array Prototype
    	concat(value, ...)
    	constructor: function()
    	copyWithin(targetIndex, startIndex, [endIndex=length])
    	entries()
    	every(callback, [thisArg])
    	fill(value, [startIndex=0], [endIndex=length])
    	filter(callback, [thisArg])
    	find(callback, [thisArg])
    	findIndex(callback, [thisArg])
    	flat()
    	flatMap()
    	forEach(callback, [thisArg])
    	includes(searchValue, [startIndex=0])
    	indexOf(searchValue, [startIndex=0])
    	join([separator=","])
    	keys()
    	lastIndexOf(searchValue, [startIndex=length])
    	length: 0
    	map(callback, [thisArg])
    	pop()
    	push(value, ...)
    	reduce(callback, [initialValue])
    	reduceRight(callback, [initialValue])
    	reverse()
    	shift()
    	slice([startIndex=0], [endIndex=length])
    	some(callback, [thisArg])
    	sort([compareFunction])
    	splice(startIndex, [deleteCount=0], ...itemsToAdd)
    	toLocaleString()
    	toString()
    	unshift()
    	values()
    	Symbol(Symbol.iterator)()
    	Symbol(Symbol.unscopables): {copyWithin: true, entries: true, fill: true, find: true, findIndex: true, …}
    	Object Prototype
    
    type: "notice"

    Thank you for any assistance

  • You must be logged in to reply to this topic.
Skip to toolbar