Skip to content

Commit

Permalink
fix(registration-block): render on preview (#1844)
Browse files Browse the repository at this point in the history
Co-authored-by: Derrick Koo <dkoo@users.noreply.github.com>
  • Loading branch information
miguelpeixe and dkoo authored Aug 3, 2022
1 parent 722724c commit 87b9be9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/blocks/reader-registration/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ function render_block( $attrs, $content ) {

// phpcs:disable WordPress.Security.NonceVerification.Recommended
if (
\is_user_logged_in() ||
( isset( $_GET['newspack_reader'] ) && absint( $_GET['newspack_reader'] ) )
! \is_preview() &&
( ! method_exists( '\Newspack_Popups', 'is_preview_request' ) || ! \Newspack_Popups::is_preview_request() ) &&
(
\is_user_logged_in() ||
( isset( $_GET['newspack_reader'] ) && absint( $_GET['newspack_reader'] ) )
)
) {
$registered = true;
$message = $success_message;
Expand Down

0 comments on commit 87b9be9

Please sign in to comment.