Skip to content

Commit 5d79ae3

Browse files
Coding Standards: Rename variables for WP 7.0 compliance.
Rename $id3data, $ext, and $ext_type variables to $id3_data, $extension, and $extension_type respectively, to comply with WordPress Coding Standards. See #64226.
1 parent ca49816 commit 5d79ae3

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/wp-admin/includes/image-edit.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -987,24 +987,24 @@ function wp_save_image( $post_id ) {
987987

988988
$basename = pathinfo( $path, PATHINFO_BASENAME );
989989
$dirname = pathinfo( $path, PATHINFO_DIRNAME );
990-
$ext = pathinfo( $path, PATHINFO_EXTENSION );
991-
$filename = pathinfo( $path, PATHINFO_FILENAME );
992-
$suffix = time() . rand( 100, 999 );
990+
$extension = pathinfo( $path, PATHINFO_EXTENSION );
991+
$filename = pathinfo( $path, PATHINFO_FILENAME );
992+
$suffix = time() . rand( 100, 999 );
993993

994994
if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE
995995
&& isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] !== $basename
996996
) {
997997

998998
if ( $edit_thumbnails_separately && 'thumbnail' === $target ) {
999-
$new_path = "{$dirname}/{$filename}-temp.{$ext}";
999+
$new_path = "{$dirname}/{$filename}-temp.{$extension}";
10001000
} else {
10011001
$new_path = $path;
10021002
}
10031003
} else {
10041004
while ( true ) {
10051005
$filename = preg_replace( '/-e([0-9]+)$/', '', $filename );
10061006
$filename .= "-e{$suffix}";
1007-
$new_filename = "{$filename}.{$ext}";
1007+
$new_filename = "{$filename}.{$extension}";
10081008
$new_path = "{$dirname}/$new_filename";
10091009

10101010
if ( file_exists( $new_path ) ) {

src/wp-admin/includes/media.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrid
310310
}
311311

312312
$name = $_FILES[ $file_id ]['name'];
313-
$ext = pathinfo( $name, PATHINFO_EXTENSION );
314-
$name = wp_basename( $name, ".$ext" );
313+
$extension = pathinfo( $name, PATHINFO_EXTENSION );
314+
$name = wp_basename( $name, ".$extension" );
315315

316316
$url = $file['url'];
317317
$type = $file['type'];
@@ -904,12 +904,12 @@ function wp_media_upload_handler() {
904904
}
905905

906906
$type = 'file';
907-
$ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src );
907+
$extension = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src );
908908

909-
if ( $ext ) {
910-
$ext_type = wp_ext2type( $ext );
911-
if ( 'audio' === $ext_type || 'video' === $ext_type ) {
912-
$type = $ext_type;
909+
if ( $extension ) {
910+
$extension_type = wp_ext2type( $extension );
911+
if ( 'audio' === $extension_type || 'video' === $extension_type ) {
912+
$type = $extension_type;
913913
}
914914
}
915915

src/wp-admin/includes/post.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,17 +350,17 @@ function edit_post( $post_data = null ) {
350350
}
351351

352352
if ( 'attachment' === $post_data['post_type'] && preg_match( '#^(audio|video)/#', $post_data['post_mime_type'] ) ) {
353-
$id3data = wp_get_attachment_metadata( $post_id );
354-
if ( ! is_array( $id3data ) ) {
355-
$id3data = array();
353+
$id3_data = wp_get_attachment_metadata( $post_id );
354+
if ( ! is_array( $id3_data ) ) {
355+
$id3_data = array();
356356
}
357357

358358
foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) {
359359
if ( isset( $post_data[ 'id3_' . $key ] ) ) {
360-
$id3data[ $key ] = sanitize_text_field( wp_unslash( $post_data[ 'id3_' . $key ] ) );
360+
$id3_data[ $key ] = sanitize_text_field( wp_unslash( $post_data[ 'id3_' . $key ] ) );
361361
}
362362
}
363-
wp_update_attachment_metadata( $post_id, $id3data );
363+
wp_update_attachment_metadata( $post_id, $id3_data );
364364
}
365365

366366
// Meta stuff.

0 commit comments

Comments
 (0)