Advertisement
Aurangajeb

Filter/Hook for the WPUF account page to manipulate [add/remove/modify] tabs

Jul 12th, 2021 (edited)
2,033
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. // filter/hook to modify WPUF Account page's tab/section
  2. add_filter('wpuf_account_sections',function ($sections){
  3.     //$sections['post'] = 'Lists'; //rename Post Tab to Post to Lists
  4.     //$sections['subscription'] = 'Membership'; //rename Subscription Tab to Membership
  5.     //unset( $sections['post'] ); //remove a tab (Post) from Account page
  6.     $sections['product'] = 'Products'; // add new Tab (Products) on the Account page
  7.     return $sections;
  8. },999);
  9.  
  10. // add custom tab/cpt on the WPUF Account page's tab/section
  11. add_action( 'wpuf_account_content_product', 'wpuf_my_product_section', 10, 3 ); //wpuf_account_content_(your new $sections slug name)
  12. function wpuf_my_product_section( $sections, $current_section ) {
  13.     echo do_shortcode('[wpuf_dashboard post_type="product"]'); //insert your post type (product) here
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement