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

add password support to pages #118

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open

add password support to pages #118

wants to merge 1 commit into from

Conversation

stefenphelps
Copy link
Contributor

No description provided.

Comment on lines +28 to +32
if (post_password_required($timber_post->ID)) {
Timber::render("single-password.twig", $context);
} else {
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (post_password_required($timber_post->ID)) {
Timber::render("single-password.twig", $context);
} else {
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
}
Timber::render(
post_password_required( $timber_post->ID )
? 'single-password.twig'
: array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ),
$context
);

How about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally, I prefer the more verbose conditional vs. the ternary one... but maybe that's just me. 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the big sack in a small sack, you like the small sack in the big one :)

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.

None yet

2 participants