fix: check for non-preview logged in user on account criteria #1347
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.
All Submissions:
Changes proposed in this Pull Request:
1200550061930446-as-1207301960751644/f
The user account criteria only checks for the
reader.email
store item, which is not available for non-reader accounts (admin, editor, author, contributor). This is fine for admins and editors, because we allow prompts to render for preview purposes. For example, theNewspack_Popups::is_user_admin()
method is used in the reader registration block so it renders a preview of the block.For authors and contributors it's not the case, so they end up rendering the prompt because they don't match the criteria, but in a success state, because they don't match
Newspack_Popups::is_user_admin()
either.This PR tweaks the criteria to account for "non-preview users".
How to test the changes in this Pull Request:
trunk
, create a new author usernewspack_popups_debug.matchingSegment
contains the ID of the "Not registered and not signed up for a newsletter" segmentnewspack_popups_debug.matchingSegment
isnull
Other information: