-
Notifications
You must be signed in to change notification settings - Fork 58
feat(access-control): update default patterns #4569
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
93e351a
feat(access-control): rename patterns category
thomasguillot d6009f8
feat(access-control): update registration-wall pattern
thomasguillot 7e233cd
feat(access-control): remove registration-card pattern; rename regist…
thomasguillot f6bd93d
feat(access-control): update pay-wall-one-tier
thomasguillot f4abee0
feat(access-control): update registration-wall
thomasguillot b0c1c22
fix(reader-activation): hide buttons of has sign-in or register modal
thomasguillot 1b22406
feat(access-control): update checkout button label
thomasguillot 18b6313
feat(access-control): update pay-wall-one-tier-metering pattern
thomasguillot 4260d91
feat(access-control): update registration-banner pattern
thomasguillot cf33f3e
feat(access-control): update other patterns
thomasguillot ee1a1ea
feat(access-control): dynamic block pattern content (#4570)
miguelpeixe 07e0c64
feat(reader-registration): add inline style, hide-oauth toggle, and u…
thomasguillot 34de1b7
fix(access-control): address PR review feedback on block patterns
thomasguillot 590d310
fix(access-control): fix missing semicolons and double-escaping
thomasguillot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
includes/content-gate/block-patterns/pay-wall-one-tier-metering-wide.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| <?php | ||
| /** | ||
| * Memberships Paywall with One Tier and Metering Pattern (Wide/Block Theme Layout). | ||
| * | ||
| * @package Newspack | ||
| */ | ||
|
|
||
| $metering = \Newspack\Content_Gate\Block_Patterns::get_metering_settings( $pattern_context ); | ||
| $metering_count = $metering['count']; | ||
| $metering_period = $metering['period']; | ||
| $product_id = \Newspack\Content_Gate\Block_Patterns::get_subscription_product_id( $pattern_context ); | ||
|
|
||
| $checkout_attrs = [ | ||
| 'text' => esc_html__( 'Become a member', 'newspack-plugin' ), | ||
| 'width' => 100, | ||
| 'align' => 'center', | ||
| ]; | ||
| if ( $product_id ) { | ||
| $checkout_attrs['product'] = (string) $product_id; | ||
| } | ||
|
|
||
| ?> | ||
| <!-- wp:group {"metadata":{"name":"<?php esc_html_e( 'Subscription', 'newspack-plugin' ); ?>"},"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|80","bottom":"var:preset|spacing|80","left":"var:preset|spacing|80","right":"var:preset|spacing|80"}},"border":{"radius":{"topLeft":"8px","topRight":"8px","bottomLeft":"8px","bottomRight":"8px"},"width":"1px"}},"borderColor":"base-3","layout":{"type":"constrained"}} --> | ||
| <div class="wp-block-group alignwide has-border-color has-base-3-border-color" style="border-width:1px;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;padding-top:var(--wp--preset--spacing--80);padding-right:var(--wp--preset--spacing--80);padding-bottom:var(--wp--preset--spacing--80);padding-left:var(--wp--preset--spacing--80)"> | ||
| <!-- wp:heading {"textAlign":"center","level":3,"metadata":{"name":"<?php esc_html_e( 'Title', 'newspack-plugin' ); ?>"}} --> | ||
| <h3 class="wp-block-heading has-text-align-center"> | ||
| <?php esc_html_e( 'Unlock the full article', 'newspack-plugin' ); ?> | ||
| </h3> | ||
| <!-- /wp:heading --> | ||
|
|
||
| <!-- wp:paragraph {"align":"center"} --> | ||
| <p class="has-text-align-center"> | ||
| <?php esc_html_e( 'Join a community of passionate readers and never miss a story.', 'newspack-plugin' ); ?> | ||
| </p> | ||
| <!-- /wp:paragraph --> | ||
|
|
||
| <!-- wp:columns {"metadata":{"name":"<?php esc_html_e( 'Content', 'newspack-plugin' ); ?>"},"className":"is-style-borders","style":{"spacing":{"margin":{"top":"var:preset|spacing|80","bottom":"0"}}}} --> | ||
| <div class="wp-block-columns is-style-borders" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:0"> | ||
| <!-- wp:column --> | ||
| <div class="wp-block-column"> | ||
| <!-- wp:paragraph {"align":"center"} --> | ||
| <p class="has-text-align-center"> | ||
| <?php | ||
| printf( | ||
| wp_kses_post( | ||
| /* translators: 1: number of free articles, 2: period label such as "month" or "week". */ | ||
| _n( | ||
| 'Get %1$s free article every %2$s with a free account.', | ||
| 'Get %1$s free articles every %2$s with a free account.', | ||
| $metering_count, | ||
| 'newspack-plugin' | ||
| ) | ||
| ), | ||
| '<strong>' . esc_html( $metering_count ) . '</strong>', | ||
| esc_html( $metering_period ) | ||
| ); | ||
| ?> | ||
| </p> | ||
| <!-- /wp:paragraph --> | ||
|
|
||
| <!-- wp:newspack/reader-registration {"newsletterSubscription":false,"hideOauth":true,"className":"is-style-inline"} --> | ||
| <div class="wp-block-newspack-reader-registration is-style-inline"></div> | ||
| <!-- /wp:newspack/reader-registration --> | ||
| </div> | ||
| <!-- /wp:column --> | ||
|
|
||
| <!-- wp:column --> | ||
| <div class="wp-block-column"> | ||
| <!-- wp:paragraph {"align":"center"} --> | ||
| <p class="has-text-align-center"> | ||
| <?php esc_html_e( 'Support our journalism and get unlimited access to our full archive.', 'newspack-plugin' ); ?> | ||
| </p> | ||
| <!-- /wp:paragraph --> | ||
|
|
||
| <!-- wp:newspack-blocks/checkout-button <?php echo wp_json_encode( $checkout_attrs ); ?> /--> | ||
| </div> | ||
| <!-- /wp:column --> | ||
| </div> | ||
| <!-- /wp:columns --> | ||
|
|
||
| </div> | ||
| <!-- /wp:group --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.