wp_opcache_invalidate_file
Filters whether to invalidate a file from the opcode cache.
Использование
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.
По умолчанию: true - $filepath(строка)
- The path to the PHP file to invalidate.
Список изменений
С версии 5.5.0 | Введена. |
Где вызывается хук
wp_opcache_invalidate_file
wp-admin/includes/file.php 2745
if ( apply_filters( 'wp_opcache_invalidate_file', true, $filepath ) ) {