• Resolved oavs

    (@oavs)


    So far considering I am not a PHP expert, I have successfully added my first Tab and the Gravity form .
    Somehow my second Tab is not showing. Also TAB order does not seem to work. How can I display at the top of the rest of Tabs navigations?
    Can someone please help why?

    ================================
    /* add new tab called “CustomTabPFee” */

    add_filter(‘um_account_page_default_tabs_hook’, ‘my_custom_tab_in_um’, 100 );
    function my_custom_tab_in_um( $tabs ) {
    $tabs[800][‘CustomTabPFee’][‘icon’] = ‘um-faicon-pencil-square-o’;
    $tabs[800][‘CustomTabPFee’][‘title’] = ‘Placement Report’;
    $tabs[800][‘CustomTabPFee’][‘custom’] = true;
    $tabs[800][‘CustomTabPFee’][‘show_button’] = false;
    return $tabs;
    }

    /* make our new tab hookable */

    add_action(‘um_account_tab__CustomTabPFee’, ‘um_account_tab__CustomTabPFee’);
    function um_account_tab__CustomTabPFee( $info ) {
    global $ultimatemember;
    extract( $info );

    $output = $ultimatemember->account->get_tab_output(‘CustomTabPFee’);
    if ( $output ) { echo $output; }
    }

    /* Finally we add some content in the tab */

    add_filter(‘um_account_content_hook_CustomTabPFee’, ‘um_account_content_hook_CustomTabPFee’);
    function um_account_content_hook_CustomTabPFee( $output ){
    ob_start();
    ?>

    <!– <div class=”um-field”> –>
    <div class=”gf_customfields” id=”gform_wrapper_63″>
    <!– Here goes your custom content –>
    <?php echo do_shortcode( “[gravityform id=’63’ user=’]”); ?>

    </div>
    <?php

    $output .= ob_get_contents();
    ob_end_clean();
    return $output;

    /*} */

    /* add new 2nd tab called “ContractorInvoice” */

    add_filter(‘um_account_page_default_tabs_hook’, ‘my_custom2_tab_in_um’, 200 );
    function my_custom2_tab_in_um( $tabs ) {
    $tabs[400][‘CustomTabInvoice’][‘icon’] = ‘um-faicon-pencil-square-o’;
    $tabs[400][‘CustomTabInvoice’][‘title’] = ‘AAHC Invoice’;
    $tabs[400][‘CustomTabInvoice’][‘custom’] = true;
    $tabs[400][‘CustomTabInvoice’][‘show_button’] = false;
    return $tabs;
    }

    /* make our new tab hookable */

    add_action(‘um_account_tab__CustomTabInvoice’, ‘um_account_tab__CustomTabInvoice’);
    function um_account_tab__CustomTabInvoice( $info ) {
    global $ultimatemember;
    extract( $info );

    $output = $ultimatemember->account->get_tab_output(‘CustomTabInvoice’);
    if ( $output ) { echo $output; }
    }

    /* Finally we add some content in the tab */

    add_filter(‘um_account_content_hook_CustomTabInvoice’, ‘um_account_content_hook_CustomTabInvoice’);
    function um_account_content_hook_CustomTabInvoice( $output ){
    ob_start();
    ?>

    <!– <div class=”um-field”> –>
    <div class=”gf_customfields” id=”gform_wrapper_52″>
    <!– Here goes your custom content –>
    <?php echo do_shortcode( “[gravityform id=’52’ user=’]”); ?>

    </div>
    <?php

    $output .= ob_get_contents();
    ob_end_clean();
    return $output;
    }}

    • This topic was modified 3 years, 8 months ago by oavs.
    • This topic was modified 3 years, 8 months ago by oavs.
    • This topic was modified 3 years, 8 months ago by oavs.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @oavs

    Your code has deprecated variables and classes. Please see this doc to help you with customization in version 2.0+
    https://docs.ultimatemember.com/article/69-how-do-i-add-my-extra-tabs-to-user-profiles

    Regards,

    Thread Starter oavs

    (@oavs)

    OK so that was a waste of time but thanks ?? for the new link.

    I have copied the code from the link “add several extra tabs, example” you gave me and pasted in my theme/child functions as it is just to see what it would have looked like. Nothing. No changed at all.

    Should I be doing anything else. At this stage I just want to see your example but showing nothing.

    any ideas ?

    Thread Starter oavs

    (@oavs)

    oh I get it now. It only shows if you select “profile” then in the profile shows as tabs.

    What I really wanted was to list these links on the left column under the Account navigations.

    Is there a way of doing that.

    My old code worked 100% but I could not add a second navigation and that was my firsy query.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @oavs

    You can try this tutorial to add your shortcode and content in a custom Account tab.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @oavs

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved. Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding a second custom TAB not showing’ is closed to new replies.