close

Make WordPress Core

Changeset 61643


Ignore:
Timestamp:
02/14/2026 11:45:50 PM (4 weeks ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-content/themes/twentytwenty
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php

    r60536 r61643  
    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
  • trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php

    r55276 r61643  
    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">
     
    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                                }
     
    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 ) {
  • trunk/src/wp-content/themes/twentytwenty/comments.php

    r57276 r61643  
    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>
  • trunk/src/wp-content/themes/twentytwenty/inc/custom-css.php

    r61302 r61643  
    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        }
  • trunk/src/wp-content/themes/twentytwenty/inc/svg-icons.php

    r60536 r61643  
    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}
  • trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php

    r61317 r61643  
    9999    }
    100100
    101     echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     101    echo $html;
    102102}
    103103
     
    136136    }
    137137
    138     echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     138    echo $html;
    139139}
    140140
     
    202202function 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
  • trunk/src/wp-content/themes/twentytwenty/searchform.php

    r55276 r61643  
    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">
  • trunk/src/wp-content/themes/twentytwenty/template-parts/content-cover.php

    r61317 r61643  
    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">
  • trunk/src/wp-content/themes/twentytwenty/template-parts/entry-header.php

    r61317 r61643  
    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>
  • trunk/src/wp-content/themes/twentytwenty/template-parts/featured-image.php

    r47940 r61643  
    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
  • trunk/src/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php

    r53880 r61643  
    3232            if ( $has_footer_menu || $has_social_menu ) {
    3333                ?>
    34                 <div class="footer-top<?php echo $footer_top_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
     34                <div class="footer-top<?php echo $footer_top_classes; ?>">
    3535                    <?php if ( $has_footer_menu ) { ?>
    3636
  • trunk/src/wp-content/themes/twentytwenty/template-parts/pagination.php

    r61092 r61643  
    5959        <hr class="styled-separator pagination-separator is-style-wide" aria-hidden="true" />
    6060
    61         <?php echo $posts_pagination; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped during generation. ?>
     61        <?php echo $posts_pagination; ?>
    6262
    6363    </div><!-- .pagination-wrapper -->
Note: See TracChangeset for help on using the changeset viewer.