From d5cfaef36d0572bdbfbd02a58dd1ecda1cefb669 Mon Sep 17 00:00:00 2001 From: viralsampat-multidots Date: Thu, 22 May 2025 18:29:08 +0530 Subject: [PATCH 1/3] Remove unused variable from the file. --- src/Rewrite_Command.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Rewrite_Command.php b/src/Rewrite_Command.php index de9de932..ca326a06 100644 --- a/src/Rewrite_Command.php +++ b/src/Rewrite_Command.php @@ -160,11 +160,13 @@ public function structure( $args, $assoc_args ) { // Launch a new process to flush rewrites because core expects flush // to happen after rewrites are set - $new_assoc_args = []; + $cmd = 'rewrite flush'; if ( Utils\get_flag_value( $assoc_args, 'hard' ) ) { $cmd .= ' --hard'; - $new_assoc_args['hard'] = true; + + // Check if the 'mod_rewrite' Apache module is enabled. + // If not, display a warning since regenerating the .htaccess file requires this module. if ( ! in_array( 'mod_rewrite', (array) WP_CLI::get_config( 'apache_modules' ), true ) ) { WP_CLI::warning( 'Regenerating a .htaccess file requires special configuration. See usage docs.' ); } From 22a008a618673b55aa742128a6006db15e4e682e Mon Sep 17 00:00:00 2001 From: viralsampat-multidots Date: Thu, 22 May 2025 18:58:42 +0530 Subject: [PATCH 2/3] Remove extra comments and white space --- src/Rewrite_Command.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Rewrite_Command.php b/src/Rewrite_Command.php index ca326a06..c9408521 100644 --- a/src/Rewrite_Command.php +++ b/src/Rewrite_Command.php @@ -163,10 +163,8 @@ public function structure( $args, $assoc_args ) { $cmd = 'rewrite flush'; if ( Utils\get_flag_value( $assoc_args, 'hard' ) ) { - $cmd .= ' --hard'; + $cmd .= ' --hard'; - // Check if the 'mod_rewrite' Apache module is enabled. - // If not, display a warning since regenerating the .htaccess file requires this module. if ( ! in_array( 'mod_rewrite', (array) WP_CLI::get_config( 'apache_modules' ), true ) ) { WP_CLI::warning( 'Regenerating a .htaccess file requires special configuration. See usage docs.' ); } From e9dfa898de476db26a2b0bb76316b626634e1996 Mon Sep 17 00:00:00 2001 From: viralsampat-multidots Date: Fri, 23 May 2025 11:04:50 +0530 Subject: [PATCH 3/3] Remove extra white space --- src/Rewrite_Command.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Rewrite_Command.php b/src/Rewrite_Command.php index c9408521..fe38105f 100644 --- a/src/Rewrite_Command.php +++ b/src/Rewrite_Command.php @@ -160,11 +160,9 @@ public function structure( $args, $assoc_args ) { // Launch a new process to flush rewrites because core expects flush // to happen after rewrites are set - - $cmd = 'rewrite flush'; + $cmd = 'rewrite flush'; if ( Utils\get_flag_value( $assoc_args, 'hard' ) ) { $cmd .= ' --hard'; - if ( ! in_array( 'mod_rewrite', (array) WP_CLI::get_config( 'apache_modules' ), true ) ) { WP_CLI::warning( 'Regenerating a .htaccess file requires special configuration. See usage docs.' ); }