Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support password protection #51

Merged
merged 5 commits into from
Mar 21, 2024
Merged

Support password protection #51

merged 5 commits into from
Mar 21, 2024

Conversation

joelambert
Copy link
Member

@joelambert joelambert commented Mar 19, 2024

What does this implement/fix? Explain your changes.

This adds support for password protected pages. Following the Timber guidelines this implements a middleware for pages/posts served via WordPress controllers that will render a special twig template if post_password_required() returns true.

The default template is single-password.twig but can be modified in the theme using the filter lumberjack/password_protect_template.

To ensure this isn't a breaking change if Timber::compile() returns false the middleware gracefully fallsback to the current behaviour, which is to ignore the password protect preference.

@joelambert joelambert marked this pull request as ready for review March 20, 2024 10:27
@joelambert joelambert merged commit c445c31 into master Mar 21, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants