Skip to content

Instantly share code, notes, and snippets.

@lukecav
lukecav / functions.php
Last active April 3, 2024 23:20
Logout of WordPress without confirmation message
function getLogoutUrl($redirectUrl = ''){
if(!$redirectUrl) $redirectUrl = site_url();
$return = str_replace("&", '&', wp_logout_url($redirectUrl));
return $return;
}
/**
* Bypass logout confirmation on nonce verification failure
*/
function logout_without_confirmation($action, $result){