WordPress.org

Make WordPress Core

Changeset 48081


Ignore:
Timestamp:
06/18/2020 02:43:31 PM (16 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Fix WPCS issues in wp-includes/sitemaps/.

Some of these were not caught when running composer lint:errors, but are fixed when running phpcbf directly.

Follow-up to [48072], [48080].

See #49542, #50117.

Location:
trunk/src/wp-includes/sitemaps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php

    r48072 r48081  
    4141    public function __construct() {
    4242        $stylesheet_url = $this->get_sitemap_stylesheet_url();
     43
    4344        if ( $stylesheet_url ) {
    4445            $this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylesheet_url ) . '" ?>';
    4546        }
    46         $stylesheet_index_url   = $this->get_sitemap_index_stylesheet_url();
     47
     48        $stylesheet_index_url = $this->get_sitemap_index_stylesheet_url();
     49
    4750        if ( $stylesheet_index_url ) {
    4851            $this->stylesheet_index = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylesheet_index_url ) . '" ?>';
     
    161164                    _doing_it_wrong(
    162165                        __METHOD__,
    163                         /* translators: %s: list of element names */
    164166                        sprintf(
     167                            /* translators: %s: List of element names. */
    165168                            __( 'Fields other than %s are not currently supported for the sitemap index.' ),
    166169                            implode( ',', array( 'loc', 'lastmod' ) )
     
    226229                    _doing_it_wrong(
    227230                        __METHOD__,
    228                         /* translators: %s: list of element names */
    229231                        sprintf(
     232                            /* translators: %s: List of element names. */
    230233                            __( 'Fields other than %s are not currently supported for sitemaps.' ),
    231234                            implode( ',', array( 'loc', 'lastmod', 'changefreq', 'priority' ) )
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php

    r48072 r48081  
    5353
    5454        $text = sprintf(
    55             /* translators: %s: number of URLs. */
     55            /* translators: %s: Number of URLs. */
    5656            esc_xml( __( 'Number of URLs in this XML Sitemap: %s.' ) ),
    5757            '<xsl:value-of select="count( sitemap:urlset/sitemap:url )" />'
     
    153153     */
    154154    public function get_sitemap_index_stylesheet() {
    155         $css           = $this->get_stylesheet_css();
    156         $title         = esc_xml( __( 'XML Sitemap' ) );
    157         $description   = esc_xml( __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines.' ) );
    158         $learn_more    = sprintf(
     155        $css         = $this->get_stylesheet_css();
     156        $title       = esc_xml( __( 'XML Sitemap' ) );
     157        $description = esc_xml( __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines.' ) );
     158        $learn_more  = sprintf(
    159159            '<a href="%s">%s</a>',
    160160            esc_url( __( 'https://www.sitemaps.org/' ) ),
     
    163163
    164164        $text = sprintf(
    165             /* translators: %s: number of URLs. */
     165            /* translators: %s: Number of URLs. */
    166166            esc_xml( __( 'Number of URLs in this XML Sitemap: %s.' ) ),
    167167            '<xsl:value-of select="count( sitemap:sitemapindex/sitemap:sitemap )" />'
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps.php

    r48072 r48081  
    208208
    209209        // 'pagename' is for most permalink types, name is for when the %postname% is used as a top-level field.
    210         if ( 'sitemap-xml' === $query->get( 'pagename' ) ||
    211              'sitemap-xml' === $query->get( 'name' ) ) {
     210        if ( 'sitemap-xml' === $query->get( 'pagename' )
     211            || 'sitemap-xml' === $query->get( 'name' )
     212        ) {
    212213            wp_safe_redirect( $this->index->get_index_url() );
    213214            exit();
Note: See TracChangeset for help on using the changeset viewer.