44. Building your component navigation
bp_core_add_nav_item (
‘Profile’, // Name
‘profile’ // Slug
);
bp_core_add_subnav_item (
‘profile’, // Slug of parent
‘Edit Profile’, // Name
‘edit’, // Slug of sub nav item
$bp->loggedin_user->domain . ‘/profile’, // parent URL
‘xprofile_screen_edit’ // Function to run when clicked
);
Saturday, May 30, 2009
45. bp_core_add_subnav_item (
‘profile’, // Slug of parent
‘Edit Profile’, // Name
‘edit’, // Slug of sub nav item
$bp->loggedin_user->domain . ‘/profile’, // parent URL
‘xprofile_screen_edit’ // Function to run when clicked
);
function xprofile_screen_edit() {
// Do stuff (save changes etc)
bp_core_load_template ( ‘profile/edit-profile’ );
}
[activetheme]/profile/edit-profile.php
Saturday, May 30, 2009
47. http://example.org/groups/wplovers/members/ban/345
$bp->current_component $bp->current_item $bp->current_action $bp->action_variables
(string) (string) (string) (array)
Easily create and use pretty URL’s in your components
http://example.org/members/andy/wordcamps/attended/sf/2009
Saturday, May 30, 2009