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

Fix validation error reporting for invalid attributes on the HTML element #4190

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions includes/validation/class-amp-validation-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ function( $query_vars ) {
add_action( 'wp', [ __CLASS__, 'override_validation_error_statuses' ] );

if ( self::$is_validate_request ) {
/*
* Always suppress 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.
*/
add_filter( 'show_admin_bar', '__return_false', PHP_INT_MAX );

self::add_validation_error_sourcing();
}
}
Expand Down