ga-overwrite.php
22 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Overwrite helpers. |
| 4 | * |
| 5 | * @package GoogleAnalytics |
| 6 | */ |
| 7 | |
| 8 | if (!defined('ABSPATH')) exit; |
| 9 | |
| 10 | if ( false === function_exists( 'wp_json_encode' ) ) { |
| 11 | /** |
| 12 | * Encode a variable into JSON. |
| 13 | * |
| 14 | * @param mixed $data Variable (usually an array or object) to encode as JSON. |
| 15 | * |
| 16 | * @return false|string The JSON encoded string, or false if it cannot be encoded. |
| 17 | */ |
| 18 | function wp_json_encode( $data ) { |
| 19 | return json_encode( $data ); // phpcs:ignore |
| 20 | } |
| 21 | } |
| 22 |