WordPress Login Link That Returns to the Current Page
Show a login prompt only when a WordPress visitor is signed out, then return them to the page they were reading. The secure implementation uses core URL helpers, escaped output, local destinations, page exclusions, and cache-aware verification.