pre_wp_filesize filter-hookWP 6.0.0

Filters the result of wp_filesize before the PHP function is run.

Usage

add_filter( 'pre_wp_filesize', 'wp_kama_pre_wp_filesize_filter', 10, 2 );

/**
 * Function for `pre_wp_filesize` filter-hook.
 * 
 * @param null|int $size The unfiltered value. Returning an int from the callback bypasses the filesize call.
 * @param string   $path Path to the file.
 *
 * @return null|int
 */
function wp_kama_pre_wp_filesize_filter( $size, $path ){

	// filter...
	return $size;
}
$size(null|int)
The unfiltered value. Returning an int from the callback bypasses the filesize call.
$path(string)
Path to the file.

Changelog

Since 6.0.0 Introduced.

Where the hook is called

wp_filesize()
pre_wp_filesize
wp-includes/functions.php 3566
$size = apply_filters( 'pre_wp_filesize', null, $path );

Where the hook is used in WordPress

Usage not found.