Skip to content

Commit

Permalink
Remove obsolete references to removed_unused_css_rules error code; see
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Oct 16, 2019
1 parent 8e77f91 commit 02231bf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
3 changes: 1 addition & 2 deletions includes/sanitizers/class-amp-core-theme-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ public static function get_supported_themes() {
public static function get_acceptable_errors( $template ) {
if ( isset( self::$theme_features[ $template ] ) ) {
return [
'removed_unused_css_rules' => true,
'illegal_css_at_rule' => [
'illegal_css_at_rule' => [
[
'at_rule' => 'viewport',
],
Expand Down
6 changes: 1 addition & 5 deletions includes/validation/class-amp-validated-url-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -1622,11 +1622,7 @@ public static function handle_validation_error_status_update() {
'amp_taxonomy_terms_updated' => $updated_count,
];

/*
* Re-check the post after the validation status change. This is particularly important for validation errors like
* 'removed_unused_css_rules' since whether it is accepted will determine whether other validation errors are triggered
* such as in this case 'excessive_css'.
*/
// Re-check the post after the validation status change.
if ( $updated_count > 0 ) {
$validation_results = self::recheck_post( $post->ID );
// @todo For WP_Error case, see <https://github.com/ampproject/amp-wp/issues/1166>.
Expand Down
2 changes: 0 additions & 2 deletions includes/validation/class-amp-validation-error-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2325,8 +2325,6 @@ public static function get_error_title_from_code( $error_code ) {
return __( 'Illegal CSS at-rule', 'amp' );
case 'disallowed_file_extension':
return __( 'Disallowed file extension', 'amp' );
case 'removed_unused_css_rules':
return __( 'Remove unused CSS rules', 'amp' ); // @todo This is obsolete.
default:
return __( 'Unknown Error', 'amp' );
}
Expand Down

0 comments on commit 02231bf

Please sign in to comment.