• Resolved calle81

    (@calle81)


    I want to make an extra tab in the profile overview of ultimate member. I found this code and it creates indeed a new tab. Now I want that when someone presses the tab, they are referred to a page on the website ( Example: https://www.mysite.com/mypage ). Does anyone now how you can do it?

    Here is the code that i found:

    /* First we need to extend main profile tabs */

    add_filter(‘um_profile_tabs’, ‘add_custom_profile_tab’, 1000 );
    function add_custom_profile_tab( $tabs ) {

    $tabs[‘mycustomtab’] = array(
    ‘name’ => ‘My custom tab’,
    ‘icon’ => ‘um-faicon-comments’,
    );

    return $tabs;

    }

    /* Then we just have to add content to that tab using this action */

    add_action(‘um_profile_content_mycustomtab_default’, ‘um_profile_content_mycustomtab_default’);
    function um_profile_content_mycustomtab_default( $args ) {
    echo ‘Hello world!’;
    }
    `
    Thanl

Viewing 5 replies - 1 through 5 (of 5 total)
  • Christian Clark

    (@christianmclark92)

    Click into the profile tabs and add the custom URL path to the page:

    https://pasteboard.co/IijMIkb.png

    Thread Starter calle81

    (@calle81)

    @christianmclark92 thanks for the reply but I’m not using a plugin as a “profile tabs”. This is a new tab created and added to the function.php of my theme. For what I’m doing the plugin “profile tabs” is not for me.

    Christian Clark

    (@christianmclark92)

    ” I want to make an extra tab in the profile overview of ultimate member. ”

    – If you want to create a tab of Static (static meaning you input the tab content yourself for all users) Content, then you can using the above code and adjusting the ” /* Then we just have to add content to that tab using this action */ ” line of code, with that of your Static Content.

    – If you want to create Dynamic (dynamic meaning users enter the content through their profiles themselves) Content then you’ll need to get the Profile Tab’s plugin for UM.

    Your functions file will throw back errors if you attempt to produce dynamic tab content using their documentation, their documentation is limited and unsupported.

    Thread Starter calle81

    (@calle81)

    @christianmclark92 Thanks for the reply, you are very kind. I don’t want to create any content, I just want that when a user clicks on the title or the tab icon, a page is loaded: https://www.mysite.com/zone1. I dosen’t won’t use the “profile tab” plug-in for various reasons. And that’s why I want to add it through the theme function.

    I hope you can help me. Thank you.

    Thread Starter calle81

    (@calle81)

    Closed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘extra tab in the profile overview of ultimate member with link to another page.’ is closed to new replies.