php - Redirect the edit profile page of Buddypress -


my client using buddypress on wordpress site, don't want users edit profile in buddypress.

also don't want users go /profile/edit page when clicking on adminbar.

so i'm looking way change url in de adminbar profile view page,or way redirect profile/edit page profile view page.

so from: http://[website-url]/members/[username]/profile/edit/

to: http://[website-url]/members/[username]/

any thoughts on how accomplish this?

i solved problem following code:

<?php $classes = get_body_class();     if (in_array('profile-edit',$classes)) {             wp_redirect( bp_loggedin_user_domain() ); exit;     };  ?> 

this code calls class of body. if body class has 'profile-edit' in wp_redirect function called. function asks url of buddypress loggedin user profile page , sent him page.


Comments

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

css - SVG using textPath a symbol not rendering in Firefox -

order - Notification for user in user account opencart -