wp_opcache_invalidate_file
Filters whether to invalidate a file from the opcode cache.
Usage
add_filter( 'wp_opcache_invalidate_file', 'wp_kama_opcache_invalidate_file_filter', 10, 2 ); /** * Function for `wp_opcache_invalidate_file` filter-hook. * * @param bool $will_invalidate Whether WordPress will invalidate `$filepath`. * @param string $filepath The path to the PHP file to invalidate. * * @return bool */ function wp_kama_opcache_invalidate_file_filter( $will_invalidate, $filepath ){ // filter... return $will_invalidate; }
- $will_invalidate(true|false)
- Whether WordPress will invalidate $filepath.
Default: true - $filepath(string)
- The path to the PHP file to invalidate.
Changelog
Since 5.5.0 | Introduced. |
Where the hook is called
wp_opcache_invalidate_file
wp-admin/includes/file.php 2675
if ( apply_filters( 'wp_opcache_invalidate_file', true, $filepath ) ) {