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
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -210,12 +210,11 @@ public function delete( $args, $assoc_args ) {
210
210
* Transients are saved to the database.
211
211
*/
212
212
publicfunctiontype() {
213
-
global$_wp_using_ext_object_cache;
214
-
215
-
if ( $_wp_using_ext_object_cache )
213
+
if ( wp_using_ext_object_cache() ) {
216
214
$message = 'Transients are saved to the object cache.';
217
-
else
215
+
} else {
218
216
$message = 'Transients are saved to the database.';
217
+
}
219
218
220
219
WP_CLI::line( $message );
221
220
}
@@ -224,7 +223,7 @@ public function type() {
224
223
* Deletes all expired transients.
225
224
*/
226
225
privatefunctiondelete_expired() {
227
-
global$wpdb, $_wp_using_ext_object_cache;
226
+
global$wpdb;
228
227
229
228
// Always delete all transients from DB too.
230
229
$time = current_time('timestamp');
@@ -242,7 +241,7 @@ private function delete_expired() {
242
241
WP_CLI::success( "No expired transients found." );
243
242
}
244
243
245
-
if ( $_wp_using_ext_object_cache ) {
244
+
if ( wp_using_ext_object_cache() ) {
246
245
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
246
}
248
247
}
@@ -251,7 +250,7 @@ private function delete_expired() {
251
250
* Deletes all transients.
252
251
*/
253
252
privatefunctiondelete_all() {
254
-
global$wpdb, $_wp_using_ext_object_cache;
253
+
global$wpdb;
255
254
256
255
// Always delete all transients from DB too.
257
256
$count = $wpdb->query(
@@ -266,7 +265,7 @@ private function delete_all() {
266
265
WP_CLI::success( "No transients found." );
267
266
}
268
267
269
-
if ( $_wp_using_ext_object_cache ) {
268
+
if ( wp_using_ext_object_cache() ) {
270
269
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