| 1 |
<?php |
| 2 |
/** |
| 3 |
* Renders a JSON of records. |
| 4 |
* |
| 5 |
* @package WP_Stream |
| 6 |
*/ |
| 7 |
|
| 8 |
header( 'Content-type: application/json; charset=' . get_option( 'blog_charset' ), true ); |
| 9 |
if ( version_compare( PHP_VERSION, '5.4', '<' ) ) { |
| 10 |
echo wp_stream_json_encode( $records ); // xss ok. |
| 11 |
} else { |
| 12 |
echo wp_stream_json_encode( $records, JSON_PRETTY_PRINT ); // xss ok. |
| 13 |
} |
| 14 |
|