function pc_wp_user_logout() { global $wpdb; global $pc_wp_user; $user = wp_get_current_user(); if (isset($user->ID) && !empty($user->ID)) { $user_data = $pc_wp_user->wp_user_is_linked($user->ID); if ($user_data) { if (!isset($GLOBALS['pc_only_wp_logout'])) { pc_logout(); } // check if a redirect is needed if (get_option('pg_logout_user_redirect')) { $redirect_url = pc_man_redirects('pg_logout_user_redirect'); wp_redirect($redirect_url); exit; } } } }
function pc_logout_user() { if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'pc_logout' || isset($_REQUEST['pc_logout']) || isset($_REQUEST['pg_logout'])) { include_once PC_DIR . '/functions.php'; $GLOBALS['pc_is_logging_out'] = true; pc_logout(); // if logging out through URL parameter - stop here if (!isset($_REQUEST['type'])) { return true; } // check if a redirect is needed echo pc_man_redirects('pg_logout_user_redirect'); die; } }
function pg_logout() { return pc_logout(); }