By the way, I am running WP 3.1.2 with BuddyPress 1.2.8.
I created a wrapper function, which seems to be a better way to go, but the problem persists. When I click the “All Conversations Button” link, I am redirected to the home page.
`
function my_bp_nav_adder()
{
bp_core_new_nav_item(
array(
‘name’ => __(‘All Conversations Button’, ‘buddypress’),
‘slug’ => ‘all-conversations’,
‘position’ => 75,
‘show_for_displayed_user’ => true,
‘screen_function’ => ‘all_conversations_link’,
‘item_css_id’ => ‘all-conversations’
));
}
function all_conversations_link () {
echo ‘my loop will go here’;
}
add_action( ‘bp_setup_nav’, ‘my_bp_nav_adder’ );
`
Any ideas?
Thanks!
The latest function (above) brings me to the correct url (not to the home page), and it echoes the all_conversations_link() function before the html “doctype” declaration on the resulting page.
How do I get the all_conversations_link() function to echo on the tab that the bp_core_new_nav_item() function creates?
Thanks!
The following function seems to work:
`
function my_bp_nav_adder()
{
bp_core_new_nav_item(
array(
‘name’ => __(‘All Conversations Button’, ‘buddypress’),
‘slug’ => ‘all-conversations’,
‘position’ => 75,
‘show_for_displayed_user’ => true,
‘screen_function’ => ‘all_conversations_link’,
‘item_css_id’ => ‘all-conversations’
));
}
function all_conversations_link () {
//add title and content here – last is to call the members plugin.php template
add_action( ‘bp_template_title’, ‘my_all_conversations_title’ );
add_action( ‘bp_template_content’, ‘my_all_conversations_content’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}
function my_all_conversations_title() {
echo ‘My Page Title’;
}
function my_all_conversations_content() {
echo ‘Add the loop here’;
}
add_action( ‘bp_setup_nav’, ‘my_bp_nav_adder’, 100 );
`