Skip to content

Instantly share code, notes, and snippets.

@Oscar-Abad-Folgueira
Created March 22, 2022 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oscar-Abad-Folgueira/84ddbdb386a044935f0362f4655e14b5 to your computer and use it in GitHub Desktop.
Save Oscar-Abad-Folgueira/84ddbdb386a044935f0362f4655e14b5 to your computer and use it in GitHub Desktop.
WordPress Snippet: Redireccionar al salir (logout)
<?php
/**
* @snippet WordPress Snippet: Redireccionar tras salir
* @author Oscar Abad Folgueira
* @author_url https://www.oscarabadfolgueira.com
* @snippet_url https://oscarabadfolgueira.com/
*/
add_action('wp_logout','oaf_redirect_after_logout');
function oaf_redirect_after_logout(){
$inicio = home_url();
wp_redirect( $inicio );
exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment