• Hello!

    I’ve tried extending my profile menu with tabs displaying different sets of user information. I used the example posted in the UM documentation to extend the tabs –> https://docs.ultimatemember.com/article/64-extending-ultimate-member-profile-menu-using-hooks.

    It worked perfectly fine for just 1 minute and then poof, the entire profile section has vanished. I’m not sure what went wrong but it worked and it suddenly stopped working and messed up the entire profile section.

    Has anyone else tried this before? Did you face a similar problem? How did you end up solving it?

    Any help in this matter is highly appreciated. Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @seed2launch,

    have you tried turning on your custom tab in WP Admin > Ultimate Member > Settings > Appearance > Profile Menus?

    Regards,

    Thread Starter seed2launch

    (@seed2launch)

    yes, all the tabs, including the custom tabs are turned on. any other settings to be checked @champsupertramp

    Thread Starter seed2launch

    (@seed2launch)

    and btw, i added my custom tabs code in ultimate-member/includes/class-functions.php at the very end. is that the right place to add it?

    Thread Starter seed2launch

    (@seed2launch)

    ok i have figured out how to make the tabs work. it was in the form settings.

    but this is causing a bigger problem where the member directory is getting affected.

    i’ve two types of users in my system – user A and user B. and i’ve a member directory that lists user B.

    1) when logged in as user A and when i go to the member directory to view user B, i see profile tabs with user A’s information instead of user B. that is because i’ve made the profile forms specific to user B.

    how do i fix this? this is extremely stressful as the member directory seems to use the same “user” page framework.

    @champsupertramp can you please help? thank you

    Thread Starter seed2launch

    (@seed2launch)

    and also, the “edit” button is not working on the tabs. it keeps defaulting back to the “about” tab and i’m unable to edit the information under the other tabs

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @seed2launch could you please provide your code snippet so we can review? Also, we recommend that you don’t modify the core plugin files as it will get overriden on updates. You should put the custom code in child or parent theme’s functions.php file.

    Regards,

    Thread Starter seed2launch

    (@seed2launch)

    ok thaks for the advice. i’ll update it in a child theme.

    anyway, i used the following snippet and set up profile forms related to specific roles. i also used the visibility option available from the “settings-> appearance-> profile menu” so that the tabs are visible only to specific user roles.

    anyway, the following is my user role setup:
    1) type A – who can edit their own profile and browse other type A users.
    2) type B – who can edit their own profile and browse other type A users, but not type B.

    here’s the snippet. looking forward to a :

    /* Family, History & Contact Tab to be editable only by the Type A role and viewed in Member Directory */
    
    function um_Family_add_tab( $tabs ) {
    $tabs['Family'] = array(
    'name' => 'Family, History & Contact',
    'icon' => 'um-icon-android-people',
    );
    return $tabs;
    }
    add_filter( 'um_profile_tabs', 'um_Family_add_tab', 1000 );
    
    // Action
    function um_profile_content_Family_default( $args ) {
    echo do_shortcode( '[ultimatemember form_id="940"]' );
    }
    add_action( 'um_profile_content_Family_default', 'um_profile_content_Family_default' );
    
    /* Farming Practices & Processing - to be edited only by the Type A role and viewed in Member Directory */
    
    function um_Farming_add_tab( $tabs ) {
    $tabs['Farming'] = array(
    'name' => 'Farming Practices & Processing',
    'icon' => 'um-faicon-tags',
    );
    return $tabs;
    }
    add_filter( 'um_profile_tabs', 'um_Farming_add_tab', 1000 );
    
    // Action
    function um_profile_content_Farming_default( $args ) {
    echo do_shortcode( '[ultimatemember form_id="941"]' );
    }
    add_action( 'um_profile_content_Farming_default', 'um_profile_content_Farming_default' );
    
    /* Place, Harvest, Production & Merits to be edited only by Type A users and viewed in Member Directory */
    
    function um_Place_add_tab( $tabs ) {
    $tabs['Place'] = array(
    'name' => 'Place, Harvest, Production & Merits',
    'icon' => 'um-icon-android-globe',
    );
    return $tabs;
    }
    add_filter( 'um_profile_tabs', 'um_Place_add_tab', 1000 );
    
    // Action
    function um_profile_content_Place_default( $args ) {
    echo do_shortcode( '[ultimatemember form_id="942"]' );
    }
    add_action( 'um_profile_content_Place_default', 'um_profile_content_Place_default' );
    
    /* Coffee Lot Info to be edited only by Type A users and viewed in Member Directory */
    
    function um_Coffee_add_tab( $tabs ) {
    $tabs['Coffee'] = array(
    'name' => 'Coffee Lot Info',
    'icon' => 'um-icon-coffee',
    );
    return $tabs;
    }
    add_filter( 'um_profile_tabs', 'um_Coffee_add_tab', 1000 );
    
    // Action
    function um_profile_content_Coffee_default( $args ) {
    echo do_shortcode( '[ultimatemember form_id="953"]' );
    }
    add_action( 'um_profile_content_Coffee_default', 'um_profile_content_Coffee_default' );
    
    /* Roaster Profile - to be edited and viewed only by logged in Type B user */ 
    
    function um_Roaster_add_tab( $tabs ) {
    $tabs['Roaster'] = array(
    'name' => 'Roaster Profile',
    'icon' => 'um-faicon-building',
    );
    return $tabs;
    }
    add_filter( 'um_profile_tabs', 'um_Roaster_add_tab', 1000 );
    
    // Action
    function um_profile_content_Roaster_default( $args ) {
    echo do_shortcode( '[ultimatemember form_id="1999"]' );
    }
    add_action( 'um_profile_content_Roaster_default', 'um_profile_content_Roaster_default' );
    
    /* Roaster Production, Planning & Buying Strategy - to be edited and viewed only by logged in Type B user */
    
    function um_Buying_add_tab( $tabs ) {
    $tabs['Buying'] = array(
    'name' => 'Production, Planning & Buying Strategy',
    'icon' => 'um-faicon-tags',
    );
    return $tabs;
    }
    add_filter( 'um_profile_tabs', 'um_Buying_add_tab', 1000 );
    
    // Action
    function um_profile_content_Buying_default( $args ) {
    echo do_shortcode( '[ultimatemember form_id="2017"]' );
    }
    add_action( 'um_profile_content_Buying_default', 'um_profile_content_Buying_default' );
    
    /* About You - to be edited and viewed only by logged in Type B user */
    
    function um_About_add_tab( $tabs ) {
    $tabs['About'] = array(
    'name' => 'About You',
    'icon' => 'um-icon-android-person',
    );
    return $tabs;
    }
    add_filter( 'um_profile_tabs', 'um_About_add_tab', 1000 );
    
    // Action
    function um_profile_content_About_default( $args ) {
    echo do_shortcode( '[ultimatemember form_id="2026"]' );
    }
    add_action( 'um_profile_content_About_default', 'um_profile_content_About_default' );

    please do let me know if you need anything else. and i really appreciate your help in this regard. thanks a ton.

    Thread Starter seed2launch

    (@seed2launch)

    @champsupertramp were you able to review the snippet?

    please let me know.

    thank you very much and have a wonderful day!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Extending Profile Menu with Tabs’ is closed to new replies.