Fix syntax for single- and multi-line comments in wp-admin-directory files.

See #28931.


git-svn-id: https://develop.svn.wordpress.org/trunk@29206 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes (DrewAPicture)
2014-07-17 09:13:53 +00:00
parent 161266c17d
commit 6ddc1e5f6d
61 changed files with 570 additions and 369 deletions
+12 -10
View File
@@ -411,7 +411,7 @@ function image_edit_apply_changes( $image, $changes ) {
if ( !is_array($changes) )
return $image;
// expand change operations
// Expand change operations.
foreach ( $changes as $key => $obj ) {
if ( isset($obj->r) ) {
$obj->type = 'rotate';
@@ -429,7 +429,7 @@ function image_edit_apply_changes( $image, $changes ) {
$changes[$key] = $obj;
}
// combine operations
// Combine operations.
if ( count($changes) > 1 ) {
$filtered = array($changes[0]);
for ( $i = 0, $j = 1; $j < count($changes); $j++ ) {
@@ -453,7 +453,7 @@ function image_edit_apply_changes( $image, $changes ) {
unset($filtered);
}
// image resource before applying the changes
// Image resource before applying the changes.
if ( $image instanceof WP_Image_Editor ) {
/**
@@ -540,7 +540,7 @@ function stream_preview_image( $post_id ) {
if ( $changes )
$img = image_edit_apply_changes( $img, $changes );
// scale the image
// Scale the image.
$size = $img->get_size();
$w = $size['width'];
$h = $size['height'];
@@ -576,7 +576,8 @@ function wp_restore_image($post_id) {
if ( $parts['basename'] != $data['file'] ) {
if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
// delete only if it's edited image
// Delete only if it's edited image.
if ( preg_match('/-e[0-9]{13}\./', $parts['basename']) ) {
/** This filter is documented in wp-admin/custom-header.php */
@@ -601,7 +602,8 @@ function wp_restore_image($post_id) {
$data = $backup_sizes["$default_size-orig"];
if ( isset($meta['sizes'][$default_size]) && $meta['sizes'][$default_size]['file'] != $data['file'] ) {
if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
// delete only if it's edited image
// Delete only if it's edited image
if ( preg_match('/-e[0-9]{13}-/', $meta['sizes'][$default_size]['file']) ) {
/** This filter is documented in wp-admin/custom-header.php */
$delpath = apply_filters( 'wp_delete_file', path_join($parts['dirname'], $meta['sizes'][$default_size]['file']) );
@@ -661,10 +663,10 @@ function wp_save_image( $post_id ) {
$sX = $size['width'];
$sY = $size['height'];
// check if it has roughly the same w / h ratio
// Check if it has roughly the same w / h ratio.
$diff = round($sX / $sY, 2) - round($fwidth / $fheight, 2);
if ( -0.1 < $diff && $diff < 0.1 ) {
// scale the full size image
// Scale the full size image.
if ( $img->resize( $fwidth, $fheight ) )
$scaled = true;
}
@@ -693,7 +695,7 @@ function wp_save_image( $post_id ) {
if ( !is_array($backup_sizes) )
$backup_sizes = array();
// generate new filename
// Generate new filename.
$path = get_attached_file($post_id);
$path_parts = pathinfo( $path );
$filename = $path_parts['filename'];
@@ -719,7 +721,7 @@ function wp_save_image( $post_id ) {
}
}
// save the full-size file, also needed to create sub-sizes
// Save the full-size file, also needed to create sub-sizes.
if ( !wp_save_image_file($new_path, $img, $post->post_mime_type, $post_id) ) {
$return->error = esc_js( __('Unable to save the image.') );
return $return;