From dd83d8f4c91a560cc19e1d161c76986d8c50b79f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 15 Mar 2019 21:55:50 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `WP_Post` where possible. Props andizer. Fixes #46508. Built from https://develop.svn.wordpress.org/trunk@44914 git-svn-id: http://core.svn.wordpress.org/trunk@44745 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-post.php | 20 ++++++++++---------- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wp-includes/class-wp-post.php b/wp-includes/class-wp-post.php index 67edf8a07c..a64a0d346f 100644 --- a/wp-includes/class-wp-post.php +++ b/wp-includes/class-wp-post.php @@ -276,19 +276,19 @@ final class WP_Post { * @return bool */ public function __isset( $key ) { - if ( 'ancestors' == $key ) { + if ( 'ancestors' === $key ) { return true; } - if ( 'page_template' == $key ) { + if ( 'page_template' === $key ) { return true; } - if ( 'post_category' == $key ) { + if ( 'post_category' === $key ) { return true; } - if ( 'tags_input' == $key ) { + if ( 'tags_input' === $key ) { return true; } @@ -304,11 +304,11 @@ final class WP_Post { * @return mixed */ public function __get( $key ) { - if ( 'page_template' == $key && $this->__isset( $key ) ) { + if ( 'page_template' === $key && $this->__isset( $key ) ) { return get_post_meta( $this->ID, '_wp_page_template', true ); } - if ( 'post_category' == $key ) { + if ( 'post_category' === $key ) { if ( is_object_in_taxonomy( $this->post_type, 'category' ) ) { $terms = get_the_terms( $this, 'category' ); } @@ -320,7 +320,7 @@ final class WP_Post { return wp_list_pluck( $terms, 'term_id' ); } - if ( 'tags_input' == $key ) { + if ( 'tags_input' === $key ) { if ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) ) { $terms = get_the_terms( $this, 'post_tag' ); } @@ -333,7 +333,7 @@ final class WP_Post { } // Rest of the values need filtering. - if ( 'ancestors' == $key ) { + if ( 'ancestors' === $key ) { $value = get_post_ancestors( $this ); } else { $value = get_post_meta( $this->ID, $key, true ); @@ -355,11 +355,11 @@ final class WP_Post { * @return array|bool|object|WP_Post */ public function filter( $filter ) { - if ( $this->filter == $filter ) { + if ( $this->filter === $filter ) { return $this; } - if ( $filter == 'raw' ) { + if ( 'raw' === $filter ) { return self::get_instance( $this->ID ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 760614ed01..66832399cb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-44913'; +$wp_version = '5.2-alpha-44914'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.