wp-force-password-change
wp-force-password-change copied to clipboard
Redirect to other page than profile.php
Hi Simon, thanks for your plugin ! But I try to change the redirect url to a custom page with a form added by the shortcode from pippinplugins. So I try as jibranb said, with changing the url but it doesn't work and I'm always redirected to the wp-admin/profile page. This is the code : `function redirect() {
global $current_user;
if ( is_admin() ) {
$screen = get_current_screen();
if ( 'profile' == $screen->base )
return;
if ( 'plugins' == $screen->base )
return;
} else {
global $wp;
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
if ( strpos( $current_url, 'connexion-collaborateur' ) ) {
return;
}
}
if ( !is_user_logged_in() )
return;
wp_get_current_user();
if ( get_user_meta( $current_user->ID, 'force-password-change', true ) ) {
wp_redirect( get_site_url() . '/changement-mdp' );
exit; // never forget this after wp_redirect!
}
}`
Would you say me what is wrong ? After that, I'll have an other question ;-)
Thanks a lot !!