Changeset 46206 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 09/20/2019 08:07:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r46133 r46206 1117 1117 } 1118 1118 $changeset_data = json_decode( $changeset_post->post_content, true ); 1119 if ( function_exists( 'json_last_error' ) && json_last_error() ) { 1120 return new WP_Error( 'json_parse_error', '', json_last_error() ); 1119 $last_error = json_last_error(); 1120 if ( $last_error ) { 1121 return new WP_Error( 'json_parse_error', '', $last_error ); 1121 1122 } 1122 1123 if ( ! is_array( $changeset_data ) ) { … … 2844 2845 2845 2846 // Gather the data for wp_insert_post()/wp_update_post(). 2846 $json_options = 0; 2847 if ( defined( 'JSON_UNESCAPED_SLASHES' ) ) { 2848 $json_options |= JSON_UNESCAPED_SLASHES; // Introduced in PHP 5.4. This is only to improve readability as slashes needn't be escaped in storage. 2849 } 2850 $json_options |= JSON_PRETTY_PRINT; // Also introduced in PHP 5.4, but WP defines constant for back compat. See WP Trac #30139. 2851 $post_array = array( 2852 'post_content' => wp_json_encode( $data, $json_options ), 2847 $post_array = array( 2848 // JSON_UNESCAPED_SLASHES is only to improve readability as slashes needn't be escaped in storage. 2849 'post_content' => wp_json_encode( $data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ), 2853 2850 ); 2854 2851 if ( $args['title'] ) {
Note: See TracChangeset
for help on using the changeset viewer.