-
Author
-
November 21, 2013 at 15:57 #7025mcgreggorParticipant
Hi,
I’ve added 2 more tabs next to the profile image by adding the code below to functions.php.
function kleo_my_actions()
{
global $bp_tabs;
//rename tab 'About me' to 'About the artist'
$bp_tabs['base'] = array(
'type' => 'regular',
'name' => apply_filters('kleo_extra_tab2',__('About the artist', 'kleo_framework')),
'group' => 'General Info',
'class' => 'regulartab'
);
// Add tab 'Additional'
$bp_tabs['additional'] = array(
'type' => 'regular',
'name' => __('Additional information', 'kleo_framework'),
'class' => 'regulartab'
);
// Add tab 'Contact Details'
$bp_tabs['contact details'] = array(
'type' => 'regular',
'name' => __('Contact Details', 'kleo_framework'),
'class' => 'regulartab'
);}
I need to hide the tabs “additional information” and “contact details” for non-paying members. Can this be done?
Thanks
McGreggorNovember 22, 2013 at 03:01 #7071SQadminKeymasterYou could try adding those two arrays in a if condition to check for level IDs:
COPY CODEif ( pmpro_hasMembershipLevel(array(2,3))) { $bp_tabs 2 arrays .... }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 22, 2013 at 16:10 #7101mcgreggorParticipantThanks but that’s not what I’m after. I guess I wasn’t clear enough before.
I want the tabs not displayed on members pages if that member is not a paying member.Something like this but it isn’t working:
COPY CODE$user_id = $bp->displayed_user->id; if (pmpro_hasMembershipLevel(NULL, $user_id)) { $bp_tabs 2 arrays .... }
Thanks for helping me out.
November 25, 2013 at 11:58 #7202SQadminKeymasterHi, The code above has some missing parts. This should do the trick:
COPY CODEadd_action('bp_after_member_header','kleo_my_actions1', 1); function kleo_my_actions1() { global $bp_tabs; $bp_tabs = array(); $bp_tabs['base'] = array( 'type' => 'regular', 'name' => apply_filters('kleo_extra_tab2',__('About the artist', 'kleo_framework')), 'group' => 'General Info', 'class' => 'regulartab' ); $user_id = bp_displayed_user_id(); if (pmpro_hasMembershipLevel(array(5,6), $user_id)) { // Add tab 'Additional' $bp_tabs['additional'] = array( 'type' => 'regular', 'name' => __('Additional information', 'kleo_framework'), 'class' => 'regulartab' ); // Add tab 'Contact Details' $bp_tabs['contact details'] = array( 'type' => 'regular', 'name' => __('Contact Details', 'kleo_framework'), 'class' => 'regulartab' ); } }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 25, 2013 at 12:45 #7206mcgreggorParticipantPerfect!
Thanks once again for a great theme and top-notch support!
November 25, 2013 at 19:42 #7218SQadminKeymasterGlad we could help 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.