Skip to content

Commit 9afec2a

Browse files
committed
fix: Simplify error messages for granular cache flush commands
Remove " or a persistent object cache with group flushing support" suffix from error messages to match test expectations. Commands now show: - "Flushing all post caches requires WordPress 6.1+" - "Flushing all term caches requires WordPress 6.1+" - "Flushing all comment caches requires WordPress 6.1+" - "Flushing all user caches requires WordPress 6.1+" - "Flushing all option caches requires WordPress 6.1+"
1 parent fe5e609 commit 9afec2a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/Cache_Command.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ public function flush_post( $args ) {
642642
WP_CLI::success( "Post cache for ID $post_id cleared." );
643643
} else {
644644
if ( ! function_exists( 'wp_cache_supports' ) || ! wp_cache_supports( 'flush_group' ) ) {
645-
WP_CLI::error( 'Flushing all post caches requires WordPress 6.1+ or a persistent object cache with group flushing support.' );
645+
WP_CLI::error( 'Flushing all post caches requires WordPress 6.1+' );
646646
}
647647
wp_cache_flush_group( 'posts' );
648648
wp_cache_flush_group( 'post_meta' );
@@ -680,7 +680,7 @@ public function flush_term( $args ) {
680680
WP_CLI::success( "Term cache for ID $term_id cleared." );
681681
} else {
682682
if ( ! function_exists( 'wp_cache_supports' ) || ! wp_cache_supports( 'flush_group' ) ) {
683-
WP_CLI::error( 'Flushing all term caches requires WordPress 6.1+ or a persistent object cache with group flushing support.' );
683+
WP_CLI::error( 'Flushing all term caches requires WordPress 6.1+' );
684684
}
685685
wp_cache_flush_group( 'terms' );
686686
wp_cache_flush_group( 'term_meta' );
@@ -718,7 +718,7 @@ public function flush_comment( $args ) {
718718
WP_CLI::success( "Comment cache for ID $comment_id cleared." );
719719
} else {
720720
if ( ! function_exists( 'wp_cache_supports' ) || ! wp_cache_supports( 'flush_group' ) ) {
721-
WP_CLI::error( 'Flushing all comment caches requires WordPress 6.1+ or a persistent object cache with group flushing support.' );
721+
WP_CLI::error( 'Flushing all comment caches requires WordPress 6.1+' );
722722
}
723723
wp_cache_flush_group( 'comment' );
724724
wp_cache_flush_group( 'comment_meta' );
@@ -756,7 +756,7 @@ public function flush_user( $args ) {
756756
WP_CLI::success( "User cache for ID $user_id cleared." );
757757
} else {
758758
if ( ! function_exists( 'wp_cache_supports' ) || ! wp_cache_supports( 'flush_group' ) ) {
759-
WP_CLI::error( 'Flushing all user caches requires WordPress 6.1+ or a persistent object cache with group flushing support.' );
759+
WP_CLI::error( 'Flushing all user caches requires WordPress 6.1+' );
760760
}
761761
wp_cache_flush_group( 'users' );
762762
wp_cache_flush_group( 'user_meta' );
@@ -795,7 +795,7 @@ public function flush_option( $args ) {
795795
WP_CLI::success( "Option cache for '$option_name' cleared." );
796796
} else {
797797
if ( ! function_exists( 'wp_cache_supports' ) || ! wp_cache_supports( 'flush_group' ) ) {
798-
WP_CLI::error( 'Flushing all option caches requires WordPress 6.1+ or a persistent object cache with group flushing support.' );
798+
WP_CLI::error( 'Flushing all option caches requires WordPress 6.1+' );
799799
}
800800
wp_cache_flush_group( 'options' );
801801
WP_CLI::success( 'Option caches cleared.' );

0 commit comments

Comments
 (0)