Aurangajeb

override wpuf account page section label

Apr 12th, 2021
660
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* On the account page, the page that has the shortcode [wpuf_account], the terms posts are in two places. One is here(https://prnt.sc/olwg2e) and another is here(https://prnt.sc/olwg9i). So in order to turn this (https://prnt.sc/olwg2e) posts in My listing, you will have to use the following code in your child theme's functions.php file */
  2.  
  3. add_filter('wpuf_account_sections', 'wpuf_get_account_sections_custom' );
  4.  
  5. function wpuf_get_account_sections_custom($account_sections){
  6.         $account_sections = array(
  7.         array( 'slug' => 'dashboard', 'label' => __( 'Dashboard', 'wp-user-frontend' ) ),
  8.         array( 'slug' => 'posts', 'label' => __( 'My Listings', 'wp-user-frontend' ) ),
  9.         array( 'slug' => 'edit-profile', 'label' => __( 'Edit Profile', 'wp-user-frontend' ) ),
  10.         array( 'slug' => 'subscription', 'label' => __( 'Subscription', 'wp-user-frontend' ) ),
  11.         array( 'slug' => 'billing-address', 'label' => __( 'Billing Address', 'wp-user-frontend' ) ),
  12.     );
  13. return $account_sections;
  14.  
  15. }
  16.  
  17. /* Next, we have another post part on the account page. In order to turn this (https://prnt.sc/olwg9i) posts into my listings, please add the following code in your child theme's functions.php file */
  18.  
  19. add_filter('wpuf_my_account_tab_links', 'remove_posts_link');
  20.  
  21. function remove_posts_link($tabs){
  22.  
  23.         $tabs['posts']['label'] = 'My Listings';
  24.  
  25.     return $tabs;
  26. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×