• I need a custom tab in a User Profile as default tab. By default it is only possible to select “About”, “Posts”, “Messages”,… However not custom tabs that I have created.

    Can someone tell me how I can select a Custom Default Tab in:
    Settings -> Appearance -> Profile Menu -> “Profile Menu Default Tab”

Viewing 1 replies (of 1 total)
  • Then I think you might have added the new tab incorrectly.

    I was able to add a new tab, following the plugin’s documentation and select it as default.

    This is the code I use to add 2 tabs. I have only added how to fill the content of 1 tab because the 2nd one is identical.

    /**
     * Add custom profile tabs
     *
     * @param $tabs
     *
     * @return mixed
     */
    function fr_add_custom_profile_tabs( $tabs ) {
    
        $tabs[ 'registrations' ] = array(
            'name' => 'Registrations',
            'icon' => 'um-faicon-list-ul',
        );
        $tabs[ 'bookmarks' ] = array(
            'name' => 'Bookmarks',
            'icon' => 'um-faicon-bookmark',
        );
        
        return $tabs;
        
    }
    add_filter( 'um_profile_tabs', 'fr_add_custom_profile_tabs', 1000 );
    
    /**
     * Content for custom tab 'registrations'
     *
     * @param $args
     */
    function fr_profile_content_registrations( $args ) {
        echo "<p>This will show the user's registrations.</p>";
    }
    add_action( 'um_profile_content_registrations', 'fr_profile_content_registrations' );

    After saving it and loading the page, I was able to select any page as default.
    See screenshot: https://imgur.com/a/IHmzfCh

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Tab as Default Tab’ is closed to new replies.