kriskhoury
11/20/2019 - 4:36 PM

WP Custom Admin Redirects

add_action( 'admin_init', '_admin_redirects' );
function _admin_redirects() {
  if ( !is_user_logged_in() && $_SERVER['PHP_SELF'] != '/wp-admin/admin-ajax.php' ) {
    wp_redirect( '/account/' ); 
    exit;
  }
}