Skip to content

Suppress admin bar from being shown during validation requests#2500

Merged
westonruter merged 1 commit intodevelopfrom
improve/admin-bar-validation-handling
Jun 5, 2019
Merged

Suppress admin bar from being shown during validation requests#2500
westonruter merged 1 commit intodevelopfrom
improve/admin-bar-validation-handling

Conversation

@westonruter
Copy link
Copy Markdown
Member

@westonruter westonruter commented Jun 4, 2019

This change always suppresses the admin bar from being shown when performing a validation request. This ensures that user-initiated validation requests perform the same as validation requests initiated by the WP-CLI command wp amp validate-site, which does so as an unauthenticated user. Unauthenticated users should not be shown the admin bar, and normal site visitors who read AMP content (such as via an AMP Cache) are not authenticated, so it doesn't make sense to include the admin bar when doing validation.

This will further prevent confusion when saving a post and there being validation errors reported, but when the user goes to the post on the frontend they see no problem because the admin bar would have been hidden entirely already via #2346.

This does not change what the user sees when browsing AMP pages served by WordPress.

See #1921.

Before

image

image

After

image

image

@westonruter westonruter added this to the v1.2 milestone Jun 4, 2019
@googlebot googlebot added the cla: yes Signed the Google CLA label Jun 4, 2019
@westonruter westonruter force-pushed the improve/admin-bar-validation-handling branch from cccbf14 to d83bb25 Compare June 5, 2019 18:19
@westonruter westonruter requested a review from amedina June 5, 2019 18:20
@westonruter westonruter marked this pull request as ready for review June 5, 2019 18:20
Copy link
Copy Markdown
Member

@amedina amedina left a comment

Choose a reason for hiding this comment

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

Yes! Seemingly little change with large impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Signed the Google CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants