pre_move_uploaded_file

pre_move_uploaded_file

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('pre_move_uploaded_file') is found 1 times:

  • /wp-admin/includes/file.php line 1010
    	 * }
    	 * @param string   $new_file      Filename of the newly-uploaded file.
    	 * @param string   $type          Mime type of the newly-uploaded file.
    	 */
    	$move_new_file = apply_filters( 'pre_move_uploaded_file', null, $file, $new_file, $type );
    
    	if ( null === $move_new_file ) {
    		if ( 'wp_handle_upload' === $action ) {
    			$move_new_file = @move_uploaded_file( $file['tmp_name'], $new_file );
    		} else {
    			// Use copy and unlink because rename breaks streams.