Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:51:22 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use Yoda conditions in some wp-admin files.

Props subrataemfluence, marcio-zebedeu, bookdude13, 1naveengiri, alishankhan.
Fixes #44365, #48455.

File:
1 edited

Legend:

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

    r47198 r47218  
    5656$sendback = wp_get_referer();
    5757if ( ! $sendback ||
    58     strpos( $sendback, 'post.php' ) !== false ||
    59     strpos( $sendback, 'post-new.php' ) !== false ) {
     58    false !== strpos( $sendback, 'post.php' ) ||
     59    false !== strpos( $sendback, 'post-new.php' ) ) {
    6060    if ( 'attachment' == $post_type ) {
    6161        $sendback = admin_url( 'upload.php' );
     
    161161            $post_new_file = 'media-new.php';
    162162        } else {
    163             if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) {
     163            if ( isset( $post_type_object ) && $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) {
    164164                $parent_file = $post_type_object->show_in_menu;
    165165            } else {
     
    180180         * @param WP_Post $post    Post object.
    181181         */
    182         if ( apply_filters( 'replace_editor', false, $post ) === true ) {
     182        if ( true === apply_filters( 'replace_editor', false, $post ) ) {
    183183            break;
    184184        }
     
    310310        }
    311311
    312         if ( $post->post_type == 'attachment' ) {
     312        if ( 'attachment' === $post->post_type ) {
    313313            $force = ( ! MEDIA_TRASH );
    314314            if ( ! wp_delete_attachment( $post_id, $force ) ) {
Note: See TracChangeset for help on using the changeset viewer.