Skip to content

Commit

Permalink
Merge pull request #3532 from 10up/fix/depreciated-warning-json_encode
Browse files Browse the repository at this point in the history
Fix: PHP Deprecated:  json_encode(): Passing null to parameter #2
  • Loading branch information
felipeelia committed Jul 5, 2023
2 parents 65e105f + 5d2179d commit cb47bb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/classes/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}

Expand Down

0 comments on commit cb47bb1

Please sign in to comment.