You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Transient_Command.php
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -210,12 +210,13 @@ public function delete( $args, $assoc_args ) {
210
210
* Transients are saved to the wp_options table.
211
211
*/
212
212
publicfunctiontype() {
213
-
global$_wp_using_ext_object_cache, $wpdb;
213
+
global$wpdb;
214
214
215
-
if ( $_wp_using_ext_object_cache )
215
+
if ( wp_using_ext_object_cache() ) {
216
216
$message = 'Transients are saved to the object cache.';
217
-
else
217
+
} else {
218
218
$message = 'Transients are saved to the ' . $wpdb->prefix . 'options table.';
219
+
}
219
220
220
221
WP_CLI::line( $message );
221
222
}
@@ -224,7 +225,7 @@ public function type() {
224
225
* Deletes all expired transients.
225
226
*/
226
227
privatefunctiondelete_expired() {
227
-
global$wpdb, $_wp_using_ext_object_cache;
228
+
global$wpdb;
228
229
229
230
// Always delete all transients from DB too.
230
231
$time = current_time('timestamp');
@@ -242,7 +243,7 @@ private function delete_expired() {
242
243
WP_CLI::success( "No expired transients found." );
243
244
}
244
245
245
-
if ( $_wp_using_ext_object_cache ) {
246
+
if ( wp_using_ext_object_cache() ) {
246
247
WP_CLI::warning( 'Transients are stored in an external object cache, and this command only deletes those stored in the database. You must flush the cache to delete all transients.');
247
248
}
248
249
}
@@ -251,7 +252,7 @@ private function delete_expired() {
251
252
* Deletes all transients.
252
253
*/
253
254
privatefunctiondelete_all() {
254
-
global$wpdb, $_wp_using_ext_object_cache;
255
+
global$wpdb;
255
256
256
257
// Always delete all transients from DB too.
257
258
$count = $wpdb->query(
@@ -266,7 +267,7 @@ private function delete_all() {
266
267
WP_CLI::success( "No transients found." );
267
268
}
268
269
269
-
if ( $_wp_using_ext_object_cache ) {
270
+
if ( wp_using_ext_object_cache() ) {
270
271
WP_CLI::warning( 'Transients are stored in an external object cache, and this command only deletes those stored in the database. You must flush the cache to delete all transients.');
0 commit comments