WordPress.org

Make WordPress Core

Changeset 30075


Ignore:
Timestamp:
10/28/2014 09:12:10 PM (6 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r29382 r30075  
    124124}
    125125endif;
     126
     127// JSON_PRETTY_PRINT was introduced in PHP 5.4
     128// Defined here to prevent a notice when using it with wp_json_encode()
     129if ( ! defined( 'JSON_PRETTY_PRINT' ) ) {
     130    define( 'JSON_PRETTY_PRINT', 128 );
     131}
Note: See TracChangeset for help on using the changeset viewer.