Skip to content

Commit 3b64cb3

Browse files
rbackerttillkruss
andauthored
Check if WP_REDIS_PLUGIN_PATH is defined before defining (#494)
Co-authored-by: Till Krüss <[email protected]>
1 parent 4c5610e commit 3b64cb3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Require WordPress 4.6 or newer
66
- Load text-domain on-demand
77
- Call `redis_object_cache_error` action before `wp_die()`
8+
- Don't try to define `WP_REDIS_PLUGIN_PATH` twice
89

910
## 2.4.4
1011

redis-cache.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
defined( 'ABSPATH' ) || exit;
2121

2222
define( 'WP_REDIS_FILE', __FILE__ );
23-
define( 'WP_REDIS_PLUGIN_PATH', __DIR__ );
2423
define( 'WP_REDIS_BASENAME', plugin_basename( WP_REDIS_FILE ) );
2524
define( 'WP_REDIS_PLUGIN_DIR', plugin_dir_url( WP_REDIS_FILE ) );
2625

26+
if ( ! defined( 'WP_REDIS_PLUGIN_PATH' ) ) {
27+
define( 'WP_REDIS_PLUGIN_PATH', __DIR__ );
28+
}
29+
2730
$meta = get_file_data( WP_REDIS_FILE, [ 'Version' => 'Version' ] );
2831

2932
define( 'WP_REDIS_VERSION', $meta['Version'] );

0 commit comments

Comments
 (0)