Link to home
Start Free TrialLog in
Avatar of Mike Waller
Mike WallerFlag for United States of America

asked on

redirect to another page after saving s2member profile

Hi there. I’m using the s2member profile shortcode that locks down the wp-admin from subscribers. However, after the user clicks Save All Changes on the profile page, I need to redirect them to another page after the data is saved so this should be automatic. Any idea how this can be accomplished?

I do know where the profile page is inside the s2member plugin (sc-profile-in.inc.php) but what should I edit to make this work?

I also saw a site where they suggested adding the following to the functions.php page but it does redirect after clicking the Save All Changes button:

function subscriber_redirect() {
      if( is_admin() ){
            wp_redirect('http://my-domain/');
            exit;
      }
}
add_action( 'init', 'subscriber_redirect' );

Any ideas experts?
ASKER CERTIFIED SOLUTION
Avatar of James Williams
James Williams
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Waller

ASKER

tried that but it didn't work.
also, that would go on the functions.php page and not the s2member profile page, sc-profile-in.inc.php

Is that correct?
that didn't work but thanks for your effort.