wp_opcache_invalidate ( $filepath, $force = false )
- (string) filepath Path to the file, including extension, for which the opcode cache is to be cleared.
- (bool) force Invalidate even if the modification time is not newer than the file in cache. Default false.
- (bool) True if opcache was invalidated for `$filepath`, or there was nothing to invalidate. False if opcache invalidation is not available, or is disabled via filter.
- Introduced in WordPress: 5.5.0
- Deprecated in WordPress: —
Attempts to clear the opcode cache for an individual PHP file.This function can be called safely without having to check the file extension
or availability of the OPcache extension.
Whether or not invalidation is possible is cached to improve performance.