From 73ab83c8d1dc5cb0097c6b1b8808686db5966f35 Mon Sep 17 00:00:00 2001 From: Takayuki Miyoshi Date: Sun, 16 Jun 2024 17:17:31 +0900 Subject: [PATCH] Rename $args to $options #1369 --- includes/file.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/file.php b/includes/file.php index 2047b984..17a9f78e 100644 --- a/includes/file.php +++ b/includes/file.php @@ -4,11 +4,11 @@ * Validates uploaded files and moves them to the temporary directory. * * @param array $file An item of `$_FILES`. - * @param string|array $args Optional. Arguments to control behavior. + * @param string|array $options Optional. Options to control behavior. * @return array|WP_Error Array of file paths, or WP_Error if validation fails. */ -function wpcf7_unship_uploaded_file( $file, $args = '' ) { - $args = wp_parse_args( $args, array( +function wpcf7_unship_uploaded_file( $file, $options = '' ) { + $options = wp_parse_args( $options, array( 'required' => false, 'filetypes' => '', 'limit' => MB_IN_BYTES, @@ -33,13 +33,13 @@ function wpcf7_unship_uploaded_file( $file, $args = '' ) { } } - if ( isset( $args['schema'] ) and isset( $args['name'] ) ) { + if ( isset( $options['schema'] ) and isset( $options['name'] ) ) { $context = array( 'file' => true, - 'field' => $args['name'], + 'field' => $options['name'], ); - foreach ( $args['schema']->validate( $context ) as $result ) { + foreach ( $options['schema']->validate( $context ) as $result ) { if ( is_wp_error( $result ) ) { return $result; } @@ -64,7 +64,7 @@ function wpcf7_unship_uploaded_file( $file, $args = '' ) { $filename = wpcf7_antiscript_file_name( $filename ); $filename = apply_filters( 'wpcf7_upload_file_name', - $filename, $name, $args + $filename, $name, $options ); $filename = wp_unique_filename( $uploads_dir, $filename );