Title: wp_upload_bits
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘wp_upload_bits’, array|string $upload_bits_error )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#wp--skip-link--target)

Filters whether to treat the upload bits as an error.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#description)󠁿

Returning a non-array from the filter will effectively short-circuit preparing the
upload bits and return that value instead. An error message should be returned as
a string.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#parameters)󠁿

 `$upload_bits_error`array|string

An array of upload bits data, or error message to return.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#source)󠁿

    ```php
    $upload_bits_error = apply_filters(
    	'wp_upload_bits',
    	array(
    		'name' => $name,
    		'bits' => $bits,
    		'time' => $time,
    	)
    );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/functions.php#L2922)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/functions.php#L2922-L2929)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_upload_bits()](https://developer.wordpress.org/reference/functions/wp_upload_bits/)`wp-includes/functions.php` |

Creates a file in the upload folder with given content.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_upload_bits/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_upload_bits%2F)
before being able to contribute a note or feedback.