Plugin development
-
Hi all.
Only a small question about plugin development in BuddyPress. How is it possible to show content using a header navigation.
As far as I understand you register a slug and then associate a screen function to the slug?
function bp_new_header_nav_setup() {
global $bp;
$blog_id = $bp->new->options['blog_id'];
$url = get_blog_option( $blog_id, 'siteurl' );
$selected = ( bp_is_page( BP_NEW_SLUG ) ) ? ' class="selected"' : '';
$title = __( 'New', 'New' );
echo sprintf('<li%s>%s', $selected, get_option('home'), BP_NEW_SLUG, $title, $title );
$result = bp_core_new_nav_item( array( 'name' => __('New', 'buddypress'),
'slug' => BP_NEW_SLUG,
'position' => 50,
'screen_function' => 'new_screen' ) );
do_action( 'bp_addwebcam_header_nav_setup' );
}
add_action( 'bp_nav_items', 'bp_addwebcam_header_nav_setup', 99);
}
So that is my code and as far as I can see the function bp_core_new_nav_item() returns false. So this seems wrong and as a result I only got: Page not found messages.
Any ideas are greatly appreciated.
Thanks in advance,
sascha
- The topic ‘Plugin development’ is closed to new replies.