mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.
See #47632. git-svn-id: https://develop.svn.wordpress.org/trunk@45583 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -654,11 +654,12 @@ function stream_preview_image( $post_id ) {
|
||||
* @return stdClass Image restoration message object.
|
||||
*/
|
||||
function wp_restore_image( $post_id ) {
|
||||
$meta = wp_get_attachment_metadata( $post_id );
|
||||
$file = get_attached_file( $post_id );
|
||||
$backup_sizes = $old_backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
|
||||
$restored = false;
|
||||
$msg = new stdClass;
|
||||
$meta = wp_get_attachment_metadata( $post_id );
|
||||
$file = get_attached_file( $post_id );
|
||||
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
|
||||
$old_backup_sizes = $backup_sizes;
|
||||
$restored = false;
|
||||
$msg = new stdClass;
|
||||
|
||||
if ( ! is_array( $backup_sizes ) ) {
|
||||
$msg->error = __( 'Cannot load image metadata.' );
|
||||
@@ -747,7 +748,10 @@ function wp_save_image( $post_id ) {
|
||||
$_wp_additional_image_sizes = wp_get_additional_image_sizes();
|
||||
|
||||
$return = new stdClass;
|
||||
$success = $delete = $scaled = $nocrop = false;
|
||||
$success = false;
|
||||
$delete = false;
|
||||
$scaled = false;
|
||||
$nocrop = false;
|
||||
$post = get_post( $post_id );
|
||||
|
||||
$img = wp_get_image_editor( _load_image_to_edit_path( $post_id, 'full' ) );
|
||||
@@ -874,7 +878,9 @@ function wp_save_image( $post_id ) {
|
||||
$return->fh = $meta['height'];
|
||||
} elseif ( 'thumbnail' == $target ) {
|
||||
$sizes = array( 'thumbnail' );
|
||||
$success = $delete = $nocrop = true;
|
||||
$success = true;
|
||||
$delete = true;
|
||||
$nocrop = true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -944,7 +950,8 @@ function wp_save_image( $post_id ) {
|
||||
$return->thumbnail = $thumb_url[0];
|
||||
} else {
|
||||
$file_url = wp_get_attachment_url( $post_id );
|
||||
if ( ! empty( $meta['sizes']['thumbnail'] ) && $thumb = $meta['sizes']['thumbnail'] ) {
|
||||
if ( ! empty( $meta['sizes']['thumbnail'] ) ) {
|
||||
$thumb = $meta['sizes']['thumbnail'];
|
||||
$return->thumbnail = path_join( dirname( $file_url ), $thumb['file'] );
|
||||
} else {
|
||||
$return->thumbnail = "$file_url?w=128&h=128";
|
||||
|
||||
Reference in New Issue
Block a user