Make WordPress Core


Ignore:
Timestamp:
08/07/2019 11:40:00 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/edit.php.

Props davidbaumwald.
Fixes #47201.

File:
1 edited

Legend:

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

    r45674 r45759  
    5757unset( $_redirect );
    5858
    59 if ( 'post' != $post_type ) {
     59if ( 'post' !== $post_type ) {
    6060    $parent_file   = "edit.php?post_type=$post_type";
    6161    $submenu_file  = "edit.php?post_type=$post_type";
     
    8181    }
    8282
    83     if ( 'delete_all' == $doaction ) {
     83    if ( 'delete_all' === $doaction ) {
    8484        // Prepare for deletion of all posts with a specified post status (i.e. Empty trash).
    8585        $post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] );
     
    157157                }
    158158
    159                 if ( $post_del->post_type == 'attachment' ) {
     159                if ( 'attachment' === $post_del->post_type ) {
    160160                    if ( ! wp_delete_attachment( $post_id ) ) {
    161161                        wp_die( __( 'Error in deleting.' ) );
     
    209209$title = $post_type_object->labels->name;
    210210
    211 if ( 'post' == $post_type ) {
     211if ( 'post' === $post_type ) {
    212212    get_current_screen()->add_help_tab(
    213213        array(
     
    262262    );
    263263
    264 } elseif ( 'page' == $post_type ) {
     264} elseif ( 'page' === $post_type ) {
    265265    get_current_screen()->add_help_tab(
    266266        array(
     
    384384    }
    385385
    386     if ( $message == 'trashed' && isset( $_REQUEST['ids'] ) ) {
     386    if ( 'trashed' === $message && isset( $_REQUEST['ids'] ) ) {
    387387        $ids        = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );
    388388        $messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", 'bulk-posts' ) ) . '">' . __( 'Undo' ) . '</a>';
Note: See TracChangeset for help on using the changeset viewer.