WordPress (always) redirect to homepage after logout.

Screenshot_20160722_085334
This piece of code is trivial and very useful for development of custom sites and cms.

add to functions.php

add_filter('logout_url', 'projectivemotion_logout_home', 10, 2);

function projectivemotion_logout_home($logouturl, $redir)
{
$redir = get_option('siteurl');
return $logouturl . '&redirect_to=' . urlencode($redir);
}

Enjoy! Happy Coding!
– Amado Martinez / Projectivemotion Web Development