Make WordPress Core

Changeset 44914


Ignore:
Timestamp:
03/15/2019 09:54:29 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in WP_Post where possible.

Props andizer.
Fixes #46508.

File:
1 edited

Legend:

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

    r43177 r44914  
    277277         */
    278278        public function __isset( $key ) {
    279                 if ( 'ancestors' == $key ) {
     279                if ( 'ancestors' === $key ) {
    280280                        return true;
    281281                }
    282282
    283                 if ( 'page_template' == $key ) {
     283                if ( 'page_template' === $key ) {
    284284                        return true;
    285285                }
    286286
    287                 if ( 'post_category' == $key ) {
     287                if ( 'post_category' === $key ) {
    288288                        return true;
    289289                }
    290290
    291                 if ( 'tags_input' == $key ) {
     291                if ( 'tags_input' === $key ) {
    292292                        return true;
    293293                }
     
    305305         */
    306306        public function __get( $key ) {
    307                 if ( 'page_template' == $key && $this->__isset( $key ) ) {
     307                if ( 'page_template' === $key && $this->__isset( $key ) ) {
    308308                        return get_post_meta( $this->ID, '_wp_page_template', true );
    309309                }
    310310
    311                 if ( 'post_category' == $key ) {
     311                if ( 'post_category' === $key ) {
    312312                        if ( is_object_in_taxonomy( $this->post_type, 'category' ) ) {
    313313                                $terms = get_the_terms( $this, 'category' );
     
    321321                }
    322322
    323                 if ( 'tags_input' == $key ) {
     323                if ( 'tags_input' === $key ) {
    324324                        if ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) ) {
    325325                                $terms = get_the_terms( $this, 'post_tag' );
     
    334334
    335335                // Rest of the values need filtering.
    336                 if ( 'ancestors' == $key ) {
     336                if ( 'ancestors' === $key ) {
    337337                        $value = get_post_ancestors( $this );
    338338                } else {
     
    356356         */
    357357        public function filter( $filter ) {
    358                 if ( $this->filter == $filter ) {
     358                if ( $this->filter === $filter ) {
    359359                        return $this;
    360360                }
    361361
    362                 if ( $filter == 'raw' ) {
     362                if ( 'raw' === $filter ) {
    363363                        return self::get_instance( $this->ID );
    364364                }
Note: See TracChangeset for help on using the changeset viewer.