Last active
February 16, 2023 22:50
-
-
Save gtamborero/bfaf62f85a195d0bfa82c4c013de2f06 to your computer and use it in GitHub Desktop.
Redirigir a una URL después de hacer login (WordPress)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Redirección a ruta concreta | |
function iproject_login_redirect( $redirect_to, $request, $user ) { | |
return 'https://www.iproject.cat/landing1'; | |
} | |
add_filter( 'login_redirect', 'iproject_login_redirect', 10, 3 ); | |
// Si quieres fusionar el filtro y la función puedes hacerlo usando una función anónima: | |
add_filter( 'login_redirect', function ( $redirect_to, $request, $user ) { | |
return 'https://www.iproject.cat/landing2'; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment