Simplify the logic for printing "Lost your password?" link. props ktdreyer. fixes #16498.
Define the variable before using it. fixes #23181.
Prevent an unintended visibility change from "Password protected" to "Public" when updating the post.

props thomasvanderbeek. fixes #23065.