pre_wp_filesize WordPress Filter Hook
The pre_wp_filesize hook is fired before the file size is calculated for a new WordPress attachment. This hook can be used to modify the attachment's file size before it is saved to the database.
apply_filters( 'pre_wp_filesize', null|int $size , string $path ) #
Filters the result of wp_filesize before the PHP function is run.
Parameters
- $size
(null|int)The unfiltered value. Returning an int from the callback bypasses the filesize call.
- $path
(string)Path to the file.
Source
Changelog
Version | Description |
---|---|
6.0.0 | Introduced. |