Make WordPress Core


Ignore:
Timestamp:
07/01/2019 12:50:14 PM (7 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.

See #47632.

File:
1 edited

Legend:

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

    r45499 r45583  
    655655 */
    656656function wp_restore_image( $post_id ) {
    657         $meta         = wp_get_attachment_metadata( $post_id );
    658         $file         = get_attached_file( $post_id );
    659         $backup_sizes = $old_backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
    660         $restored     = false;
    661         $msg          = new stdClass;
     657        $meta             = wp_get_attachment_metadata( $post_id );
     658        $file             = get_attached_file( $post_id );
     659        $backup_sizes     = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
     660        $old_backup_sizes = $backup_sizes;
     661        $restored         = false;
     662        $msg              = new stdClass;
    662663
    663664        if ( ! is_array( $backup_sizes ) ) {
    … …  
    748749
    749750        $return  = new stdClass;
    750         $success = $delete = $scaled = $nocrop = false;
     751        $success = false;
     752        $delete  = false;
     753        $scaled  = false;
     754        $nocrop  = false;
    751755        $post    = get_post( $post_id );
    752756
    … …  
    875879        } elseif ( 'thumbnail' == $target ) {
    876880                $sizes   = array( 'thumbnail' );
    877                 $success = $delete = $nocrop = true;
     881                $success = true;
     882                $delete  = true;
     883                $nocrop  = true;
    878884        }
    879885
    … …  
    945951                        } else {
    946952                                $file_url = wp_get_attachment_url( $post_id );
    947                                 if ( ! empty( $meta['sizes']['thumbnail'] ) && $thumb = $meta['sizes']['thumbnail'] ) {
     953                                if ( ! empty( $meta['sizes']['thumbnail'] ) ) {
     954                                        $thumb             = $meta['sizes']['thumbnail'];
    948955                                        $return->thumbnail = path_join( dirname( $file_url ), $thumb['file'] );
    949956                                } else {
Note: See TracChangeset for help on using the changeset viewer.