From 5d2179d775dac4946e2ffcfeb0c0fc55e6ffe767 Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Wed, 5 Jul 2023 16:53:45 +0500 Subject: [PATCH] Fix: PHP Deprecated: json_encode(): Passing null to parameter #2 --- includes/classes/Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Command.php b/includes/classes/Command.php index 784e8083d2..823cf82849 100644 --- a/includes/classes/Command.php +++ b/includes/classes/Command.php @@ -1516,7 +1516,7 @@ protected function print_json_response( $response, $pretty ) { * @param boolean $pretty_print_flag Whether it should or not be formatted. */ protected function pretty_json_encode( $json_obj, $pretty_print_flag ) { - $flag = $pretty_print_flag ? JSON_PRETTY_PRINT : null; + $flag = $pretty_print_flag ? JSON_PRETTY_PRINT : 0; WP_CLI::line( wp_json_encode( $json_obj, $flag ) ); }