Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save xavi-tristancho/d097c9301f1c165ff670e0dc88b1807c to your computer and use it in GitHub Desktop.

Select an option

Save xavi-tristancho/d097c9301f1c165ff670e0dc88b1807c to your computer and use it in GitHub Desktop.
Add a new tab to the buddypress profile showing paidmemberships pro account information
function buddypress_paidmembershipspro_account_tab()
{
global $bp;
bp_core_new_nav_item(array(
'name' => 'Account',
'slug' => 'account',
'parent_url' => bp_displayed_user_domain() . '/account/',
'parent_slug' => $bp->profile->slug,
'default_subnav_slug' => 'account',
'position' => 100,
'screen_function' => 'buddypress_paidmembershipspro_account',
'show_for_displayed_user' => false,
'item_css_id' => 'buddypress_paidmembershipspro_account'
));
}
add_action('bp_setup_nav', 'buddypress_paidmembershipspro_account_tab', 1000);
function buddypress_paidmembershipspro_account()
{
add_action('bp_template_title', 'buddypress_paidmembershipspro_account_tab_title');
add_action('bp_template_content', 'buddypress_paidmembershipspro_account_tab_content');
bp_core_load_template( 'members/single/plugins' );
}
function buddypress_paidmembershipspro_account_tab_title()
{
'Account';
}
function buddypress_paidmembershipspro_account_tab_content()
{
echo do_shortcode("[pmpro_account]");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment