WPUF Account Page Customization

WPUF Account Page Customization 1
Customize WP User Frontend Account Page

If you want to customize your WPUF Account page, you can use the below filter/hook of the plugin to add a new Tab, delete an existing tab, update/rename an existing tab, or load a different template.

Add a New Tab/Menu

// filter/hook to modify WPUF Account page's tab/section
add_filter('wpuf_account_sections',function ($sections){
    $sections['product'] = 'Products'; // add new Tab (Products) on the Account page
    return $sections;
},999);

// add custom tab/cpt on the WPUF Account page's tab/section
add_action( 'wpuf_account_content_product', 'wpuf_my_product_section', 10, 3 ); //wpuf_account_content_(your new $sections slug name)
function wpuf_my_product_section( $sections, $current_section ) {
    echo do_shortcode('[wpuf_dashboard post_type="product"]'); //insert your post type (product) here
}

Rename an Existing Tab/Menu

// filter/hook to modify WPUF Account page's tab/section
add_filter('wpuf_account_sections',function ($sections){
    //unset( $sections['post'] ); //remove the (Post) tab from Account page
    return $sections;
},999);

Delete an Existing Tab/Menu

// filter/hook to modify WPUF Account page's tab/section
add_filter('wpuf_account_sections',function ($sections){
    //$sections['post'] = 'Articles'; //rename Post the tab
    //$sections['subscription'] = 'Membership'; //rename the Subscription tab to Membership
    return $sections;
},999);

You need to inject this snippet into your theme/child theme’s functions.php file. Else you can use a third-party plugin like “Code Snippets.”

Default image
MM Aurangajeb

Spreading Happiness. Support Engineer, WordPress Enthusiast, Blogger.

Articles: 18

Newsletter Updates

Enter your email address below to subscribe to our newsletter