ajax check if is_user_logged_in() code example Example: detect logged user wordpress javascript document.body.classList.contains( 'logged-in' );