Aurangajeb

Remove the post section from the My Account

Jan 20th, 2020
1,064
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. /* Remove the post section from the My Account */
  2.  
  3. add_filter('wpuf_my_account_tab_links', 'remove_posts_link');
  4.  
  5. function remove_posts_link($tabs){
  6.  
  7.     if(isset($tabs['posts'])) {
  8.        
  9.         unset($tabs['posts']);
  10.     }
  11.  
  12.     return $tabs;
  13. }
  14.  
  15. add_filter('wpuf_account_sections', 'wpuf_get_account_sections_custom' );
  16.  
  17. function wpuf_get_account_sections_custom($account_sections){
  18.     foreach ($account_sections as $key=>$section) {
  19.         if(isset($section['slug']) && $section['slug'] == 'posts') {
  20.             unset($account_sections[$key]);
  21.         }
  22.     }
  23.     return $account_sections;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment