Define JSON_PRETTY_PRINT so it can be used with wp_json_encode()

* `JSON_PRETTY_PRINT` was introduced in PHP 5.4
* Now you can use it with lower PHP versions, without a notice

fixes #30139
see #28786
Built from https://develop.svn.wordpress.org/trunk@30075


git-svn-id: http://core.svn.wordpress.org/trunk@30075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2014-10-28 21:13:22 +00:00
parent 0f64edb657
commit 45afcde640
2 changed files with 8 additions and 2 deletions

View File

@ -122,4 +122,10 @@ function hash_equals( $a, $b ) {
return $result === 0;
}
endif;
endif;
// JSON_PRETTY_PRINT was introduced in PHP 5.4
// Defined here to prevent a notice when using it with wp_json_encode()
if ( ! defined( 'JSON_PRETTY_PRINT' ) ) {
define( 'JSON_PRETTY_PRINT', 128 );
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-alpha-30074';
$wp_version = '4.1-alpha-30075';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.