I have used the above code.
<?php
function no_mp_redirect(){
wp-redirect(site_url('wp-login.php?action=register'));
}
add_action('ws_plugin__s2member_before_membership_options_page','no_mp_redirect'); //This is a hook
add_action('ws_plugin__s2member_before_wp_redirect_w_mop_vars','no_mp_redirect'); //This is another hook in the same class... I'm not sure which is the best to use.
?>
but i get the error –
Fatal error: Call to undefined function redirect() in /home/content/43/11414443/html/playandwin/wp-content/mu-plugins/s2-hacks.php on line 4
The i searched on google and found that function is actually wp_redirect in place of wp-redirect. So i changed code to following-
<?php
function no_mp_redirect(){
wp_redirect(site_url('wp-login.php?action=register'));
}
add_action('ws_plugin__s2member_before_membership_options_page','no_mp_redirect'); //This is a hook
add_action('ws_plugin__s2member_before_wp_redirect_w_mop_vars','no_mp_redirect'); //This is another hook in the same class... I'm not sure which is the best to use.
?>
Now when i navigate to authenticated pages in site, then error does not come, but yet membership options page shows.