WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/feed.php

    r47617 r47808  
    8686     */
    8787    $default_feed = apply_filters( 'default_feed', 'rss2' );
    88     return 'rss' == $default_feed ? 'rss2' : $default_feed;
     88
     89    return ( 'rss' === $default_feed ) ? 'rss2' : $default_feed;
    8990}
    9091
     
    161162     * @param string $title The current post title.
    162163     */
    163     $title = apply_filters( 'the_title_rss', $title );
    164     return $title;
     164    return apply_filters( 'the_title_rss', $title );
    165165}
    166166
     
    191191    $content = apply_filters( 'the_content', get_the_content() );
    192192    $content = str_replace( ']]>', ']]>', $content );
     193
    193194    /**
    194195     * Filters the post content for use in feeds.
     
    383384
    384385    $filter = 'rss';
    385     if ( 'atom' == $type ) {
     386    if ( 'atom' === $type ) {
    386387        $filter = 'raw';
    387388    }
     
    402403
    403404    foreach ( $cat_names as $cat_name ) {
    404         if ( 'rdf' == $type ) {
     405        if ( 'rdf' === $type ) {
    405406            $the_list .= "\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n";
    406         } elseif ( 'atom' == $type ) {
     407        } elseif ( 'atom' === $type ) {
    407408            $the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', esc_attr( get_bloginfo_rss( 'url' ) ), esc_attr( $cat_name ) );
    408409        } else {
Note: See TracChangeset for help on using the changeset viewer.