Make WordPress Core

Ticket #47201: 47201.diff

File 47201.diff, 2.2 KB (added by davidbaumwald, 6 years ago)

Patch with resolutions

  • src/wp-admin/edit.php

    diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php
    index d9333b9778..4f0e1fa5fc 100644
    a b foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) { 
    5656}
    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";
    6262        $post_new_file = "post-new.php?post_type=$post_type";
    if ( $doaction ) { 
    8080                $sendback = admin_url( $post_new_file );
    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'] );
    8686                // Validate the post status exists.
    if ( $doaction ) { 
    155155                                        wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
    156156                                }
    157157
    158                                 if ( $post_del->post_type == 'attachment' ) {
     158                                if ( 'attachment' === $post_del->post_type ) {
    159159                                        if ( ! wp_delete_attachment( $post_id ) ) {
    160160                                                wp_die( __( 'Error in deleting.' ) );
    161161                                        }
    if ( 'wp_block' === $post_type ) { 
    207207
    208208$title = $post_type_object->labels->name;
    209209
    210 if ( 'post' == $post_type ) {
     210if ( 'post' === $post_type ) {
    211211        get_current_screen()->add_help_tab(
    212212                array(
    213213                        'id'      => 'overview',
    if ( 'post' == $post_type ) { 
    260260                '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    261261        );
    262262
    263 } elseif ( 'page' == $post_type ) {
     263} elseif ( 'page' === $post_type ) {
    264264        get_current_screen()->add_help_tab(
    265265                array(
    266266                        'id'      => 'overview',
    foreach ( $bulk_counts as $message => $count ) { 
    382382                $messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) );
    383383        }
    384384
    385         if ( $message == 'trashed' && isset( $_REQUEST['ids'] ) ) {
     385        if ( 'trashed' === $message && isset( $_REQUEST['ids'] ) ) {
    386386                $ids        = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );
    387387                $messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", 'bulk-posts' ) ) . '">' . __( 'Undo' ) . '</a>';
    388388        }