Make WordPress Core

Changeset 60248


Ignore:
Timestamp:
05/24/2025 10:49:25 PM (8 weeks ago)
Author:
SergeyBiryukov
Message:

Twenty Seventeen: Escape translations in block patterns.

Follow-up to [49584].

Props viralsampat, sabernhardt, dilipbheda, SirLouen, darshitrajyaguru97.
Fixes #63264.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/inc/block-patterns.php

    r57323 r60248  
    1515    register_block_pattern_category(
    1616        'twentyseventeen',
    17         array( 'label' => __( 'Twenty Seventeen', 'twentyseventeen' ) )
     17        array( 'label' => esc_html__( 'Twenty Seventeen', 'twentyseventeen' ) )
    1818    );
    1919}
     
    2626        'twentyseventeen/large-heading-with-button',
    2727        array(
    28             'title'      => __( 'Large Heading with Button', 'twentyseventeen' ),
     28            'title'      => esc_html__( 'Large Heading with Button', 'twentyseventeen' ),
    2929            'categories' => array( 'twentyseventeen' ),
    3030            'content'    => '<!-- wp:heading {"level":1,"textColor":"black","style":{"typography":{"fontSize":50}}} -->
    31             <h1 class="has-black-color has-text-color" style="font-size:50px">' . __( 'Attract Leads with Marketing Campaigns that Work', 'twentyseventeen' ) . '</h1>
     31            <h1 class="has-black-color has-text-color" style="font-size:50px">' . esc_html__( 'Attract Leads with Marketing Campaigns that Work', 'twentyseventeen' ) . '</h1>
    3232            <!-- /wp:heading -->
    3333
    3434            <!-- wp:buttons -->
    3535            <div class="wp-block-buttons"><!-- wp:button {"borderRadius":0,"className":"is-style-fill"} -->
    36             <div class="wp-block-button is-style-fill"><a class="wp-block-button__link no-border-radius">' . __( 'Our Services', 'twentyseventeen' ) . '</a></div>
     36            <div class="wp-block-button is-style-fill"><a class="wp-block-button__link no-border-radius">' . esc_html__( 'Our Services', 'twentyseventeen' ) . '</a></div>
    3737            <!-- /wp:button --></div>
    3838            <!-- /wp:buttons -->',
     
    4343        'twentyseventeen/images-with-text-and-link',
    4444        array(
    45             'title'      => __( 'Images with Text and Link', 'twentyseventeen' ),
     45            'title'      => esc_html__( 'Images with Text and Link', 'twentyseventeen' ),
    4646            'categories' => array( 'twentyseventeen' ),
    4747            'content'    => '<!-- wp:spacer -->
     
    5252            <div class="wp-block-column">
    5353            <!-- wp:image {"className":"size-large"} -->
    54             <figure class="wp-block-image size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/stripes.jpg" alt="' . __( 'Black Stripes', 'twentyseventeen' ) . '"/></figure>
     54            <figure class="wp-block-image size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/stripes.jpg" alt="' . esc_attr__( 'Black Stripes', 'twentyseventeen' ) . '"/></figure>
    5555            <!-- /wp:image -->
    5656            <!-- wp:heading {"textColor":"black","style":{"typography":{"fontSize":45}}} -->
    57             <h2 class="has-black-color has-text-color" style="font-size:45px">' . __( 'Branding', 'twentyseventeen' ) . '</h2>
     57            <h2 class="has-black-color has-text-color" style="font-size:45px">' . esc_html__( 'Branding', 'twentyseventeen' ) . '</h2>
    5858            <!-- /wp:heading -->
    5959            <!-- wp:paragraph {"textColor":"black","style":{"typography":{"lineHeight":"1.8"}}} -->
    60             <p class="has-black-color has-text-color" style="line-height:1.8">' . __( 'Communicate your purpose and goals with a beautiful logo that encapsulates your business.', 'twentyseventeen' ) . '</p>
     60            <p class="has-black-color has-text-color" style="line-height:1.8">' . esc_html__( 'Communicate your purpose and goals with a beautiful logo that encapsulates your business.', 'twentyseventeen' ) . '</p>
    6161            <!-- /wp:paragraph -->
    6262            <!-- wp:paragraph {"style":{"typography":{"lineHeight":"3"}}} -->
    63             <p style="line-height:3"><a href="#"><strong>' . __( 'See Case Study', 'twentyseventeen' ) . ' →</strong></a></p>
     63            <p style="line-height:3"><a href="#"><strong>' . esc_html__( 'See Case Study', 'twentyseventeen' ) . ' →</strong></a></p>
    6464            <!-- /wp:paragraph --></div>
    6565            <!-- /wp:column -->
     
    6969            <!-- /wp:spacer -->
    7070            <!-- wp:image {"className":"size-large"} -->
    71             <figure class="wp-block-image size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/white-border.jpg" alt="' . __( 'White border', 'twentyseventeen' ) . '"/></figure>
     71            <figure class="wp-block-image size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/white-border.jpg" alt="' . esc_attr__( 'White border', 'twentyseventeen' ) . '"/></figure>
    7272            <!-- /wp:image -->
    7373            <!-- wp:heading {"textColor":"black","style":{"typography":{"fontSize":45}}} -->
    74             <h2 class="has-black-color has-text-color" style="font-size:45px">' . __( 'Web Design', 'twentyseventeen' ) . '</h2>
     74            <h2 class="has-black-color has-text-color" style="font-size:45px">' . esc_html__( 'Web Design', 'twentyseventeen' ) . '</h2>
    7575            <!-- /wp:heading -->
    7676            <!-- wp:paragraph {"textColor":"black","style":{"typography":{"lineHeight":"1.8"}}} -->
    77             <p class="has-black-color has-text-color" style="line-height:1.8">' . __( 'Need a website? We&#39;ve got you covered. Our design team will create a stunning design to transform your brand.', 'twentyseventeen' ) . '</p>
     77            <p class="has-black-color has-text-color" style="line-height:1.8">' . esc_html__( 'Need a website? We&#39;ve got you covered. Our design team will create a stunning design to transform your brand.', 'twentyseventeen' ) . '</p>
    7878            <!-- /wp:paragraph -->
    7979            <!-- wp:paragraph {"style":{"typography":{"lineHeight":"3.0"}}} -->
    80             <p style="line-height:3.0"><a href="#"><strong>' . __( 'See Case Study', 'twentyseventeen' ) . ' →</strong></a></p>
     80            <p style="line-height:3.0"><a href="#"><strong>' . esc_html__( 'See Case Study', 'twentyseventeen' ) . ' →</strong></a></p>
    8181            <!-- /wp:paragraph --></div>
    8282            <!-- /wp:column --></div>
     
    8888        'twentyseventeen/images-with-link',
    8989        array(
    90             'title'      => __( 'Images with Link', 'twentyseventeen' ),
     90            'title'      => esc_html__( 'Images with Link', 'twentyseventeen' ),
    9191            'categories' => array( 'twentyseventeen' ),
    9292            'content'    => '<!-- wp:spacer -->
     
    9898            <div class="wp-block-group"><div class="wp-block-group__inner-container">
    9999            <!-- wp:image {"align":"center","sizeSlug":"large","className":"is-style-default"} -->
    100             <div class="wp-block-image is-style-default"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/stripes.jpg" alt="' . __( 'Black Stripes', 'twentyseventeen' ) . '"/></figure></div>
     100            <div class="wp-block-image is-style-default"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/stripes.jpg" alt="' . esc_attr__( 'Black Stripes', 'twentyseventeen' ) . '"/></figure></div>
    101101            <!-- /wp:image -->
    102102            <!-- wp:heading {"align":"left","textColor":"black","style":{"typography":{"fontSize":30}}} -->
    103             <h2 class="has-text-align-left has-black-color has-text-color" style="font-size:30px">' . __( 'Branding', 'twentyseventeen' ) . '</h2>
     103            <h2 class="has-text-align-left has-black-color has-text-color" style="font-size:30px">' . esc_html__( 'Branding', 'twentyseventeen' ) . '</h2>
    104104            <!-- /wp:heading -->
    105105            <!-- wp:paragraph {"align":"left"} -->
    106             <p class="has-text-align-left"><a href="#">' . __( 'See Case Study', 'twentyseventeen' ) . ' →</a></p>
     106            <p class="has-text-align-left"><a href="#">' . esc_html__( 'See Case Study', 'twentyseventeen' ) . ' →</a></p>
    107107            <!-- /wp:paragraph --></div></div>
    108108            <!-- /wp:group --></div>
     
    112112            <div class="wp-block-group"><div class="wp-block-group__inner-container">
    113113            <!-- wp:image {"align":"center","sizeSlug":"large","className":"is-style-default"} -->
    114             <div class="wp-block-image is-style-default"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/white-border.jpg" alt="' . __( 'White border', 'twentyseventeen' ) . '"/></figure></div>
     114            <div class="wp-block-image is-style-default"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/white-border.jpg" alt="' . esc_attr__( 'White border', 'twentyseventeen' ) . '"/></figure></div>
    115115            <!-- /wp:image -->
    116116            <!-- wp:heading {"align":"left","textColor":"black","style":{"typography":{"fontSize":30}}} -->
    117             <h2 class="has-text-align-left has-black-color has-text-color" style="font-size:30px">' . __( 'Design', 'twentyseventeen' ) . '</h2>
     117            <h2 class="has-text-align-left has-black-color has-text-color" style="font-size:30px">' . esc_html__( 'Design', 'twentyseventeen' ) . '</h2>
    118118            <!-- /wp:heading -->
    119119            <!-- wp:paragraph {"align":"left"} -->
    120             <p class="has-text-align-left"><a href="#">' . __( 'See Case Study', 'twentyseventeen' ) . ' →</a></p>
     120            <p class="has-text-align-left"><a href="#">' . esc_html__( 'See Case Study', 'twentyseventeen' ) . ' →</a></p>
    121121            <!-- /wp:paragraph --></div></div>
    122122            <!-- /wp:group --></div>
     
    126126            <div class="wp-block-group"><div class="wp-block-group__inner-container">
    127127            <!-- wp:image {"align":"center","sizeSlug":"large","className":"is-style-default"} -->
    128             <div class="wp-block-image is-style-default"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/direct-light.jpg" alt="' . __( 'Direct Light', 'twentyseventeen' ) . '"/></figure></div>
     128            <div class="wp-block-image is-style-default"><figure class="aligncenter size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/direct-light.jpg" alt="' . esc_attr__( 'Direct Light', 'twentyseventeen' ) . '"/></figure></div>
    129129            <!-- /wp:image -->
    130130            <!-- wp:heading {"align":"left","textColor":"black","style":{"typography":{"fontSize":30}}} -->
    131             <h2 class="has-text-align-left has-black-color has-text-color" style="font-size:30px">' . __( 'Strategy', 'twentyseventeen' ) . '</h2>
     131            <h2 class="has-text-align-left has-black-color has-text-color" style="font-size:30px">' . esc_html__( 'Strategy', 'twentyseventeen' ) . '</h2>
    132132            <!-- /wp:heading -->
    133133            <!-- wp:paragraph {"align":"left"} -->
    134             <p class="has-text-align-left"><a href="#">' . __( 'See Case Study', 'twentyseventeen' ) . ' →</a></p>
     134            <p class="has-text-align-left"><a href="#">' . esc_html__( 'See Case Study', 'twentyseventeen' ) . ' →</a></p>
    135135            <!-- /wp:paragraph --></div></div>
    136136            <!-- /wp:group --></div>
     
    146146        'twentyseventeen/services',
    147147        array(
    148             'title'      => __( 'Services', 'twentyseventeen' ),
     148            'title'      => esc_html__( 'Services', 'twentyseventeen' ),
    149149            'categories' => array( 'twentyseventeen' ),
    150150            'content'    => '<!-- wp:spacer -->
     
    153153           
    154154            <!-- wp:heading {"level":1,"style":{"typography":{"fontSize":50}}} -->
    155             <h1 style="font-size:50px">' . __( 'Our Services', 'twentyseventeen' ) . '</h1>
     155            <h1 style="font-size:50px">' . esc_html__( 'Our Services', 'twentyseventeen' ) . '</h1>
    156156            <!-- /wp:heading -->
    157157           
     
    160160            <div class="wp-block-column">
    161161            <!-- wp:paragraph {"style":{"typography":{"fontSize":21, "lineHeight":"2.5"}}} -->
    162             <p style="font-size:21px"><a href="#">' . __( 'Branding', 'twentyseventeen' ) . ' →</a><br><a href="#">' . __( 'Web Design', 'twentyseventeen' ) . ' →</a><br><a href="#">' . __( 'Web Development', 'twentyseventeen' ) . ' →</a></p>
     162            <p style="font-size:21px"><a href="#">' . esc_html__( 'Branding', 'twentyseventeen' ) . ' →</a><br><a href="#">' . esc_html__( 'Web Design', 'twentyseventeen' ) . ' →</a><br><a href="#">' . esc_html__( 'Web Development', 'twentyseventeen' ) . ' →</a></p>
    163163            <!-- /wp:paragraph -->
    164164            </div>
     
    168168            <div class="wp-block-column">
    169169            <!-- wp:paragraph {"style":{"typography":{"fontSize":21, "lineHeight":"2.5"}}} -->
    170             <p style="font-size:21px"><a href="#">' . __( 'Content Strategy', 'twentyseventeen' ) . ' →</a><br><a href="#">' . __( 'Marketing &amp; SEO', 'twentyseventeen' ) . ' →</a><br><a href="#">' . __( 'Video Production', 'twentyseventeen' ) . ' →</a></p>
     170            <p style="font-size:21px"><a href="#">' . esc_html__( 'Content Strategy', 'twentyseventeen' ) . ' →</a><br><a href="#">' . esc_html__( 'Marketing &amp; SEO', 'twentyseventeen' ) . ' →</a><br><a href="#">' . esc_html__( 'Video Production', 'twentyseventeen' ) . ' →</a></p>
    171171            <!-- /wp:paragraph --></div>
    172172            <!-- /wp:column --></div>
     
    182182        'twentyseventeen/contact-us',
    183183        array(
    184             'title'      => __( 'Contact Us', 'twentyseventeen' ),
     184            'title'      => esc_html__( 'Contact Us', 'twentyseventeen' ),
    185185            'categories' => array( 'twentyseventeen' ),
    186186            'content'    => '<!-- wp:cover {"customOverlayColor":"#93aab8","minHeight":700,"align":"center"} -->
    187187            <div class="wp-block-cover aligncenter has-background-dim" style="background-color:#93aab8;min-height:700px"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"left","textColor":"white","style":{"typography":{"fontSize":50}}} -->
    188             <p class="has-text-align-left has-white-color has-text-color" style="font-size:50px">' . __( 'We are proud to serve outstanding clients.', 'twentyseventeen' ) . '</p>
     188            <p class="has-text-align-left has-white-color has-text-color" style="font-size:50px">' . esc_html__( 'We are proud to serve outstanding clients.', 'twentyseventeen' ) . '</p>
    189189            <!-- /wp:paragraph -->
    190190           
    191191            <!-- wp:buttons -->
    192192            <div class="wp-block-buttons"><!-- wp:button {"borderRadius":0,"backgroundColor":"black","textColor":"white","className":"is-style-fill"} -->
    193             <div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-white-color has-black-background-color has-text-color has-background no-border-radius">' . __( 'Contact us', 'twentyseventeen' ) . '</a></div>
     193            <div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-white-color has-black-background-color has-text-color has-background no-border-radius">' . esc_html__( 'Contact us', 'twentyseventeen' ) . '</a></div>
    194194            <!-- /wp:button --></div>
    195195            <!-- /wp:buttons --></div></div>
Note: See TracChangeset for help on using the changeset viewer.