Changeset 52837 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 03/10/2022 01:08:19 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/file.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r52734 r52837 2556 2556 return false; 2557 2557 } 2558 2559 /** 2560 * Wrapper for PHP filesize with filters and casting the result as an integer. 2561 * 2562 * @since 6.0.0 2563 * 2564 * @link https://www.php.net/manual/en/function.filesize.php 2565 * 2566 * @param string $path Path to the file. 2567 * @return int The size of the file in bytes, or 0 in the event of an error. 2568 */ 2569 function wp_filesize( $path ) { 2570 /** 2571 * Filters the result of wp_filesize before the PHP function is run. 2572 * 2573 * @since 6.0.0 2574 * 2575 * @param null|int $size The unfiltered value. Returning an int from the callback bypasses the filesize call. 2576 * @param string $path Path to the file. 2577 */ 2578 $size = apply_filters( 'pre_wp_filesize', null, $path ); 2579 2580 if ( is_int( $size ) ) { 2581 return $size; 2582 } 2583 2584 $size = (int) @filesize( $path ); 2585 2586 /** 2587 * Filters the size of the file. 2588 * 2589 * @since 6.0.0 2590 * 2591 * @param int $size The result of PHP filesize on the file. 2592 * @param string $path Path to the file. 2593 */ 2594 return (int) apply_filters( 'wp_filesize', $size, $path ); 2595 }
Note: See TracChangeset
for help on using the changeset viewer.