How to Add New Tabs to User Account Page?

In UsersWP, you can easily add profile tabs to user account pages using our Form Builder. However, if you wish to add custom content to such tabs, you can use a code snippet to add custom profile tabs to user account pages. 

Code Snippet to Add Custom Tabs to User Account Page

You can use the following code snippet to add custom tabs to user account page.   

We recommend using the Code Snippets plugin.

add_filter('uwp_account_available_tabs', 'uwp_account_available_tabs_cb', 10, 1);
function uwp_account_available_tabs_cb($tabs){

	$tabs['new-tab'] = array(
		'title' => __( 'My new tab', 'userswp' ),
		'icon'  => 'fas fa-user',
	);

    return $tabs;
}

add_filter('uwp_account_page_title', 'uwp_account_page_title_cb', 10, 2);
function uwp_account_page_title_cb($title, $type){
	if ( $type == 'new-tab' ) {
		$title = __( 'My new tab title', 'uwp-messaging' );
	}

	return $title;
}

add_filter('uwp_account_form_display', 'uwp_account_form_display_cb', 10, 1);
function uwp_account_form_display_cb($type){
	if ( $type == 'new-tab' ) {
        echo 'Your custom content goes here...';
	}
}

You can use any shortcode, PHP function or custom text in place of "Your custom content goes here...". 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.