Advertisement
vapvarun

Update edit profile admin bar with buddypress

Sep 1st, 2021
1,655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. // remove edit profile link from admin bar and redirect to buddypress profile link
  2. if( !current_user_can('activate_plugins') ) {
  3. function vap_admin_bar_render() {
  4.     global $wp_admin_bar;
  5.     $wp_admin_bar->remove_menu('edit-profile');
  6. }
  7. //add_action( 'wp_before_admin_bar_render', 'vap_admin_bar_render' );
  8. // uncomment above line if you want to hide extra edit-profile menu
  9. function redirect_profile_edit_to_buddypress() {
  10.     if(IS_PROFILE_PAGE === true) {
  11.         wp_redirect(home_url().'/members/me/edit');
  12.     }
  13. }
  14. add_action( 'admin_init', 'redirect_profile_edit_to_buddypress' );
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement