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.


Top ↑

Source

File: wp-includes/functions.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
6.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More