Skip to content

Commit 89e8c96

Browse files
committed
Allow CLI to flush or skip full object cache / transients
1 parent 2d576a2 commit 89e8c96

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

classes/cli/PodsAPI_CLI_Command.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,28 @@ public function deactivate_component( $args, $assoc_args ) {
343343
/**
344344
* Clear the Pods cache.
345345
*
346+
* [--skip-object-cache]
347+
* : Skip flushing the full object cache (default: Flush full object cache).
348+
*
349+
* [--skip-transients]
350+
* : Skip deleting all transients (default: Delete all transients).
351+
*
346352
* ## EXAMPLES
347353
*
348354
* wp pods-legacy-api clear-cache
349355
*
350356
* @subcommand clear-cache
351357
*/
352-
public function cache_clear() {
353-
354-
pods_api()->cache_flush_pods();
358+
public function cache_clear( $args, $assoc_args ) {
359+
360+
pods_api()->cache_flush_pods(
361+
null,
362+
true,
363+
true,
364+
false,
365+
empty( $assoc_args['skip-object-cache'] ),
366+
empty( $assoc_args['skip-transients'] )
367+
);
355368

356369
WP_CLI::success( __( 'Pods cache cleared', 'pods' ) );
357370

0 commit comments

Comments
 (0)