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