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