diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 5b11a07f6d..988314b089 100644
|
a
|
b
|
function wp_edit_theme_plugin_file( $args ) { |
| 498 | 498 | if ( false === $written ) { |
| 499 | 499 | return new WP_Error( 'unable_to_write', __( 'Unable to write to file.' ) ); |
| 500 | 500 | } |
| 501 | | if ( 'php' === $extension && function_exists( 'opcache_invalidate' ) ) { |
| | 501 | if ( 'php' === $extension && function_exists( 'opcache_invalidate' ) && ( '' === ini_get( 'opcache.restrict_api' ) || strpos( ini_get( 'opcache.restrict_api' ), 'wp-admin' ) ) ) { |
| 502 | 502 | opcache_invalidate( $real_file, true ); |
| 503 | 503 | } |
| 504 | 504 | |
| … |
… |
function wp_edit_theme_plugin_file( $args ) { |
| 608 | 608 | |
| 609 | 609 | // Roll-back file change. |
| 610 | 610 | file_put_contents( $real_file, $previous_content ); |
| 611 | | if ( function_exists( 'opcache_invalidate' ) ) { |
| | 611 | if ( function_exists( 'opcache_invalidate' ) && ( '' === ini_get( 'opcache.restrict_api' ) || strpos( ini_get( 'opcache.restrict_api' ), 'wp-admin' ) ) ) { |
| 612 | 612 | opcache_invalidate( $real_file, true ); |
| 613 | 613 | } |
| 614 | 614 | |