wp_filesize filter-hookWP 6.0.0

Filters the size of the file.

Usage

add_filter( 'wp_filesize', 'wp_kama_filesize_filter', 10, 2 );

/**
 * Function for `wp_filesize` filter-hook.
 * 
 * @param int    $size The result of PHP filesize on the file.
 * @param string $path Path to the file.
 *
 * @return int
 */
function wp_kama_filesize_filter( $size, $path ){

	// filter...
	return $size;
}
$size(int)
The result of PHP filesize on the file.
$path(string)
Path to the file.

Changelog

Since 6.0.0 Introduced.

Where the hook is called

wp_filesize()
wp_filesize
wp-includes/functions.php 3516
return (int) apply_filters( 'wp_filesize', $size, $path );

Where the hook is used in WordPress

Usage not found.