WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Пользуюсь сам и вам рекомендую!
функция не описана

wpcf7_unship_uploaded_file() CF7 1.0

Validates uploaded files and moves them to the temporary directory.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.
Хуки из функции

Возвращает

Массив|WP_Error. Array of file paths, or WP_Error if validation fails.

Использование

wpcf7_unship_uploaded_file( $file, $args );
$file(массив) (обязательный)
An item of $_FILES.
$args(строка|массив)
Arguments to control behavior.
По умолчанию: ''

Код wpcf7_unship_uploaded_file() CF7 5.5.2

function wpcf7_unship_uploaded_file( $file, $args = '' ) {
	$args = wp_parse_args( $args, array(
		'required' => false,
		'filetypes' => '',
		'limit' => MB_IN_BYTES,
	) );

	foreach ( array( 'name', 'size', 'tmp_name', 'error' ) as $key ) {
		if ( ! isset( $file[$key] ) ) {
			$file[$key] = array();
		}
	}

	$names = wpcf7_array_flatten( $file['name'] );
	$sizes = wpcf7_array_flatten( $file['size'] );
	$tmp_names = wpcf7_array_flatten( $file['tmp_name'] );
	$errors = wpcf7_array_flatten( $file['error'] );

	foreach ( $errors as $error ) {
		if ( ! empty( $error ) and UPLOAD_ERR_NO_FILE !== $error ) {
			return new WP_Error( 'wpcf7_upload_failed_php_error',
				wpcf7_get_message( 'upload_failed_php_error' )
			);
		}
	}

	if ( $args['required'] and ! array_filter( $tmp_names ) ) {
		return new WP_Error( 'wpcf7_invalid_required',
			wpcf7_get_message( 'invalid_required' )
		);
	}

	// File type validation
	$file_type_pattern = wpcf7_acceptable_filetypes(
		$args['filetypes'], 'regex'
	);

	$file_type_pattern = '/\.(' . $file_type_pattern . ')$/i';

	foreach ( $names as $name ) {
		if ( ! empty( $name ) and ! preg_match( $file_type_pattern, $name ) ) {
			return new WP_Error( 'wpcf7_upload_file_type_invalid',
				wpcf7_get_message( 'upload_file_type_invalid' )
			);
		}
	}

	// File size validation
	$total_size = array_sum( $sizes );

	if ( $args['limit'] < $total_size ) {
		return new WP_Error( 'wpcf7_upload_file_too_large',
			wpcf7_get_message( 'upload_file_too_large' )
		);
	}

	// Move uploaded file to tmp dir
	$uploads_dir = wpcf7_upload_tmp_dir();
	$uploads_dir = wpcf7_maybe_add_random_dir( $uploads_dir );

	$uploaded_files = array();

	foreach ( $names as $key => $name ) {
		$tmp_name = $tmp_names[$key];

		if ( empty( $tmp_name ) or ! is_uploaded_file( $tmp_name ) ) {
			continue;
		}

		$filename = $name;
		$filename = wpcf7_canonicalize( $filename, array( 'strto' => 'as-is' ) );
		$filename = wpcf7_antiscript_file_name( $filename );

		$filename = apply_filters( 'wpcf7_upload_file_name',
			$filename, $name, $args
		);

		$filename = wp_unique_filename( $uploads_dir, $filename );
		$new_file = path_join( $uploads_dir, $filename );

		if ( false === @move_uploaded_file( $tmp_name, $new_file ) ) {
			return new WP_Error( 'wpcf7_upload_failed',
				wpcf7_get_message( 'upload_failed' )
			);
		}

		// Make sure the uploaded file is only readable for the owner process
		chmod( $new_file, 0400 );

		$uploaded_files[] = $new_file;
	}

	return $uploaded_files;
}