juliofmndes
Respostas no Fórum
Visualizando 1 resposta (de um total de 1)
-
Fórum: Desenvolvendo com WordPress
Em resposta a: Redirecionar usuário autenticado de volta ao siteBastante, me fez fuçar o codigo e me mostrou a função home_url() ^^
Eu resolvi o problema editando o arquivo wp-login.php na parte:
if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) ) $redirect_to = user_admin_url(); elseif ( is_multisite() && !$user->has_cap('read') ) $redirect_to = get_dashboard_url( $user->ID ); elseif ( !$user->has_cap('edit_posts') ) $redirect_to = admin_url('profile.php'); } wp_safe_redirect($redirect_to); exit();
E alterando $redirect_to = admin_url(‘profile.php’); para $redirect_to = home_url();
Resultado:
if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) ) $redirect_to = user_admin_url(); elseif ( is_multisite() && !$user->has_cap('read') ) $redirect_to = get_dashboard_url( $user->ID ); elseif ( !$user->has_cap('edit_posts') ) $redirect_to = home_url(); //admin_url('profile.php'); } wp_safe_redirect($redirect_to); exit();
Fica ai a dica pra vcs =)
Vlw mesmo
Visualizando 1 resposta (de um total de 1)