Skip to content

Commit a76dd29

Browse files
Twenty Twenty: Remove EscapeOutput annotations.
These are from the `WordPress-Extra` standard, which is not included in the `phpcs.xml.dist` configuration (the repository uses `WordPress-Core`). Includes removing unnecessary `WordPress.WP.CapitalPDangit.Misspelled` annotation on the `wordpress` array key, as the `CapitalPDangit` sniff skips array definitions by design. Follow-up to [46271], [46445]. Props rodrigosprimo. See #64627. git-svn-id: https://develop.svn.wordpress.org/trunk@61643 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6710308 commit a76dd29

File tree

12 files changed

+16
-17
lines changed

12 files changed

+16
-17
lines changed

src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ public static function get_social_link_svg( $uri ) {
327327
'whatsapp' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M16.75,13.96C17,14.09 17.16,14.16 17.21,14.26C17.27,14.37 17.25,14.87 17,15.44C16.8,16 15.76,16.54 15.3,16.56C14.84,16.58 14.83,16.92 12.34,15.83C9.85,14.74 8.35,12.08 8.23,11.91C8.11,11.74 7.27,10.53 7.31,9.3C7.36,8.08 8,7.5 8.26,7.26C8.5,7 8.77,6.97 8.94,7H9.41C9.56,7 9.77,6.94 9.96,7.45L10.65,9.32C10.71,9.45 10.75,9.6 10.66,9.76L10.39,10.17L10,10.59C9.88,10.71 9.74,10.84 9.88,11.09C10,11.35 10.5,12.18 11.2,12.87C12.11,13.75 12.91,14.04 13.15,14.17C13.39,14.31 13.54,14.29 13.69,14.13L14.5,13.19C14.69,12.94 14.85,13 15.08,13.08L16.75,13.96M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C10.03,22 8.2,21.43 6.65,20.45L2,22L3.55,17.35C2.57,15.8 2,13.97 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,13.72 4.54,15.31 5.46,16.61L4.5,19.5L7.39,18.54C8.69,19.46 10.28,20 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z" />
328328
</svg>',
329329

330-
// phpcs:disable WordPress.WP.CapitalPDangit.Misspelled
331330
'wordpress' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"></path></svg>',
332331

333332
'yelp' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"></path></svg>',

src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function html5_comment( $comment, $depth, $args ) {
3737
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
3838

3939
?>
40-
<<?php echo $tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
40+
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
4141
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
4242
<footer class="comment-meta">
4343
<div class="comment-author vcard">
@@ -49,7 +49,7 @@ protected function html5_comment( $comment, $depth, $args ) {
4949
if ( empty( $comment_author_url ) ) {
5050
echo wp_kses_post( $avatar );
5151
} else {
52-
printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --Escaped in https://developer.wordpress.org/reference/functions/get_comment_author_url/
52+
printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url );
5353
echo wp_kses_post( $avatar );
5454
}
5555
}
@@ -131,7 +131,7 @@ protected function html5_comment( $comment, $depth, $args ) {
131131

132132
<?php
133133
if ( $comment_reply_link ) {
134-
echo $comment_reply_link; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Link is escaped in https://developer.wordpress.org/reference/functions/get_comment_reply_link/
134+
echo $comment_reply_link;
135135
}
136136
if ( $by_post_author ) {
137137
echo '<span class="by-post-author">' . __( 'By Post Author', 'twentytwenty' ) . '</span>';

src/wp-content/themes/twentytwenty/comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
}
8686
?>
8787

88-
<nav class="comments-pagination pagination<?php echo $pagination_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>" aria-label="<?php esc_attr_e( 'Comments', 'twentytwenty' ); ?>">
88+
<nav class="comments-pagination pagination<?php echo $pagination_classes; ?>" aria-label="<?php esc_attr_e( 'Comments', 'twentytwenty' ); ?>">
8989
<?php echo wp_kses_post( $comment_pagination ); ?>
9090
</nav>
9191

src/wp-content/themes/twentytwenty/inc/custom-css.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function twentytwenty_generate_css( $selector, $style, $value, $prefix = '', $su
3838

3939
if ( $display ) {
4040

41-
echo $return; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;)
41+
echo $return;
4242

4343
}
4444

src/wp-content/themes/twentytwenty/inc/svg-icons.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @param string $color Color code.
1919
*/
2020
function twentytwenty_the_theme_svg( $svg_name, $group = 'ui', $color = '' ) {
21-
echo twentytwenty_get_theme_svg( $svg_name, $group, $color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_theme_svg().
21+
echo twentytwenty_get_theme_svg( $svg_name, $group, $color );
2222
}
2323
}
2424

src/wp-content/themes/twentytwenty/inc/template-tags.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function twentytwenty_site_logo( $args = array(), $display = true ) {
9898
return $html;
9999
}
100100

101-
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
101+
echo $html;
102102
}
103103

104104
/**
@@ -135,7 +135,7 @@ function twentytwenty_site_description( $display = true ) {
135135
return $html;
136136
}
137137

138-
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
138+
echo $html;
139139
}
140140

141141
/**
@@ -201,7 +201,7 @@ function twentytwenty_filter_comment_reply_link( $link ) {
201201
*/
202202
function twentytwenty_the_post_meta( $post_id = null, $location = 'single-top' ) {
203203

204-
echo twentytwenty_get_post_meta( $post_id, $location ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_post_meta().
204+
echo twentytwenty_get_post_meta( $post_id, $location );
205205
}
206206

207207
/**

src/wp-content/themes/twentytwenty/searchform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$twentytwenty_aria_label = 'aria-label="' . esc_attr( $args['label'] ) . '"';
2424
}
2525
?>
26-
<form role="search" <?php echo $twentytwenty_aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
26+
<form role="search" <?php echo $twentytwenty_aria_label; ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
2727
<label for="<?php echo esc_attr( $twentytwenty_unique_id ); ?>">
2828
<span class="screen-reader-text">
2929
<?php

src/wp-content/themes/twentytwenty/template-parts/content-cover.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
$color_overlay_classes .= ' opacity-' . $color_overlay_opacity;
4545
?>
4646

47-
<div class="cover-header <?php echo $cover_header_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>"<?php echo $cover_header_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;) ?>>
47+
<div class="cover-header <?php echo $cover_header_classes; ?>"<?php echo $cover_header_style; ?>>
4848
<div class="cover-header-inner-wrapper screen-height">
4949
<div class="cover-header-inner">
50-
<div class="cover-color-overlay color-accent<?php echo esc_attr( $color_overlay_classes ); ?>"<?php echo $color_overlay_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;) ?>></div>
50+
<div class="cover-color-overlay color-accent<?php echo esc_attr( $color_overlay_classes ); ?>"<?php echo $color_overlay_style; ?>></div>
5151

5252
<header class="entry-header has-text-align-center">
5353
<div class="entry-header-inner section-inner medium">

src/wp-content/themes/twentytwenty/template-parts/entry-header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
if ( has_excerpt() && is_singular() ) {
6565
?>
6666

67-
<div class="intro-text section-inner max-percentage<?php echo $intro_text_width; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
67+
<div class="intro-text section-inner max-percentage<?php echo $intro_text_width; ?>">
6868
<?php the_excerpt(); ?>
6969
</div>
7070

src/wp-content/themes/twentytwenty/template-parts/featured-image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<figure class="featured-media">
2121

22-
<div class="featured-media-inner section-inner<?php echo $featured_media_inner_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
22+
<div class="featured-media-inner section-inner<?php echo $featured_media_inner_classes; ?>">
2323

2424
<?php
2525
the_post_thumbnail();

0 commit comments

Comments
 (0)