+ return wp_specialchars_decode( $string, $quote_style );
+ }
+}
+
+// For PHP < 5.2.0
+if ( !function_exists('json_encode') ) {
+ function json_encode( $string ) {
+ global $wp_json;
+
+ if ( !is_a($wp_json, 'Services_JSON') ) {
+ require_once( 'class-json.php' );
+ $wp_json = new Services_JSON();
+ }
+
+ return $wp_json->encodeUnsafe( $string );
+ }
+}
+
+if ( !function_exists('json_decode') ) {
+ function json_decode( $string ) {
+ global $wp_json;
+
+ if ( !is_a($wp_json, 'Services_JSON') ) {
+ require_once( 'class-json.php' );
+ $wp_json = new Services_JSON();
+ }
+
+ return $wp_json->decode( $string );