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