Skip to content

Commit 1580811

Browse files
Twenty Twenty-One: 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 `WPThemeReview` annotations carried over from upstream. Follow-up to [49216]. Props rodrigosprimo. See #64627. git-svn-id: https://develop.svn.wordpress.org/trunk@61654 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0b8bc64 commit 1580811

10 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function register( $wp_customize ) {
113113

114114
// Background color.
115115
// Include the custom control class.
116-
require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-color-control.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
116+
require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-color-control.php' );
117117

118118
// Register the custom control.
119119
$wp_customize->register_control_type( 'Twenty_Twenty_One_Customize_Color_Control' );

src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function customizer_controls( $wp_customize ) {
137137
}
138138

139139
// Custom notice control.
140-
require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-notice-control.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
140+
require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-notice-control.php' );
141141

142142
$wp_customize->add_setting(
143143
'respect_user_color_preference_notice',

src/wp-content/themes/twentytwentyone/image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
printf(
8282
'<span class="full-size-link"><span class="screen-reader-text">%1$s</span><a href="%2$s">%3$s &times; %4$s</a></span>',
8383
/* translators: Hidden accessibility text. */
84-
esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentytwentyone' ), // phpcs:ignore WordPress.Security.EscapeOutput
84+
esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentytwentyone' ),
8585
esc_url( wp_get_attachment_url() ),
8686
absint( $metadata['width'] ),
8787
absint( $metadata['height'] )

src/wp-content/themes/twentytwentyone/inc/back-compat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function twenty_twenty_one_customize() {
7979
* @return void
8080
*/
8181
function twenty_twenty_one_preview() {
82-
if ( isset( $_GET['preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
82+
if ( isset( $_GET['preview'] ) ) {
8383
wp_die(
8484
sprintf(
8585
/* translators: %s: WordPress Version. */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function twenty_twenty_one_generate_css( $selector, $style, $value, $prefix = ''
3636
* Using wp_strip_all_tags() here is sufficient escaping to avoid
3737
* malicious attempts to close </style> and open a <script>.
3838
*/
39-
echo wp_strip_all_tags( $css ); // phpcs:ignore WordPress.Security.EscapeOutput
39+
echo wp_strip_all_tags( $css );
4040
}
4141
return $css;
4242
}

src/wp-content/themes/twentytwentyone/inc/template-functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function twenty_twenty_one_get_non_latin_css( $type = 'front-end' ) {
335335

336336
// Include file if function doesn't exist.
337337
if ( ! function_exists( 'twenty_twenty_one_generate_css' ) ) {
338-
require_once get_theme_file_path( 'inc/custom-css.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
338+
require_once get_theme_file_path( 'inc/custom-css.php' );
339339
}
340340

341341
// Return the specified styles.
@@ -405,7 +405,7 @@ function twenty_twenty_one_print_first_instance_of_block( $block_name, $content
405405

406406
if ( $blocks_content ) {
407407
/** This filter is documented in wp-includes/post-template.php */
408-
echo apply_filters( 'the_content', $blocks_content ); // phpcs:ignore WordPress.Security.EscapeOutput
408+
echo apply_filters( 'the_content', $blocks_content );
409409
return true;
410410
}
411411

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function twenty_twenty_one_posted_on() {
2727
printf(
2828
/* translators: %s: Publish date. */
2929
esc_html__( 'Published %s', 'twentytwentyone' ),
30-
$time_string // phpcs:ignore WordPress.Security.EscapeOutput
30+
$time_string
3131
);
3232
echo '</span>';
3333
}
@@ -79,7 +79,7 @@ function twenty_twenty_one_entry_meta_footer() {
7979

8080
$post_format = get_post_format();
8181
if ( 'aside' === $post_format || 'status' === $post_format ) {
82-
echo '<p><a href="' . esc_url( get_permalink() ) . '">' . twenty_twenty_one_continue_reading_text() . '</a></p>'; // phpcs:ignore WordPress.Security.EscapeOutput
82+
echo '<p><a href="' . esc_url( get_permalink() ) . '">' . twenty_twenty_one_continue_reading_text() . '</a></p>';
8383
}
8484

8585
// Posted on.
@@ -105,7 +105,7 @@ function twenty_twenty_one_entry_meta_footer() {
105105
printf(
106106
/* translators: %s: List of categories. */
107107
'<span class="cat-links">' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' </span>',
108-
$categories_list // phpcs:ignore WordPress.Security.EscapeOutput
108+
$categories_list
109109
);
110110
}
111111

@@ -114,7 +114,7 @@ function twenty_twenty_one_entry_meta_footer() {
114114
printf(
115115
/* translators: %s: List of tags. */
116116
'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
117-
$tags_list // phpcs:ignore WordPress.Security.EscapeOutput
117+
$tags_list
118118
);
119119
}
120120
echo '</div>';
@@ -147,7 +147,7 @@ function twenty_twenty_one_entry_meta_footer() {
147147
printf(
148148
/* translators: %s: List of categories. */
149149
'<span class="cat-links">' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' </span>',
150-
$categories_list // phpcs:ignore WordPress.Security.EscapeOutput
150+
$categories_list
151151
);
152152
}
153153

@@ -156,7 +156,7 @@ function twenty_twenty_one_entry_meta_footer() {
156156
printf(
157157
/* translators: %s: List of tags. */
158158
'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
159-
$tags_list // phpcs:ignore WordPress.Security.EscapeOutput
159+
$tags_list
160160
);
161161
}
162162
echo '</div>';

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

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

2121
$twentytwentyone_aria_label = ! empty( $args['aria_label'] ) ? 'aria-label="' . esc_attr( $args['aria_label'] ) . '"' : '';
2222
?>
23-
<form role="search" <?php echo $twentytwentyone_aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
23+
<form role="search" <?php echo $twentytwentyone_aria_label; ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
2424
<label for="<?php echo esc_attr( $twentytwentyone_unique_id ); ?>"><?php _e( 'Search&hellip;', 'twentytwentyone' ); // phpcs:ignore: WordPress.Security.EscapeOutput.UnsafePrintingFunction -- core trusts translations ?></label>
2525
<input type="search" id="<?php echo esc_attr( $twentytwentyone_unique_id ); ?>" class="search-field" value="<?php echo get_search_query(); ?>" name="s" />
2626
<input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentytwentyone' ); ?>" />

src/wp-content/themes/twentytwentyone/template-parts/header/site-branding.php

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

3737
<?php if ( $description && true === get_theme_mod( 'display_title_and_tagline', true ) ) : ?>
3838
<p class="site-description">
39-
<?php echo $description; // phpcs:ignore WordPress.Security.EscapeOutput ?>
39+
<?php echo $description; ?>
4040
</p>
4141
<?php endif; ?>
4242
</div><!-- .site-branding -->

src/wp-content/themes/twentytwentyone/template-parts/header/site-nav.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
<div class="menu-button-container">
1515
<button id="primary-mobile-menu" class="button" aria-controls="primary-menu-list" aria-expanded="false">
1616
<span class="dropdown-icon open"><?php esc_html_e( 'Menu', 'twentytwentyone' ); ?>
17-
<?php echo twenty_twenty_one_get_icon_svg( 'ui', 'menu' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
17+
<?php echo twenty_twenty_one_get_icon_svg( 'ui', 'menu' ); ?>
1818
</span>
1919
<span class="dropdown-icon close"><?php esc_html_e( 'Close', 'twentytwentyone' ); ?>
20-
<?php echo twenty_twenty_one_get_icon_svg( 'ui', 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
20+
<?php echo twenty_twenty_one_get_icon_svg( 'ui', 'close' ); ?>
2121
</span>
2222
</button><!-- #primary-mobile-menu -->
2323
</div><!-- .menu-button-container -->

0 commit comments

Comments
 (0)