Changeset 18404
- Timestamp:
- 07/06/2011 11:33:05 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/update-core.php
r18318 r18404 245 245 // 3.2 246 246 'wp-includes/default-embeds.php', 247 'wp-includes/class-json.php',248 247 'wp-includes/js/tinymce/plugins/wordpress/img/more.gif', 249 248 'wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif', -
trunk/wp-includes/compat.php
r18111 r18404 61 61 return $hmac; 62 62 } 63 64 if ( !function_exists('json_encode') ) { 65 function json_encode( $string ) { 66 global $wp_json; 67 68 if ( !is_a($wp_json, 'Services_JSON') ) { 69 require_once( ABSPATH . WPINC . '/class-json.php' ); 70 $wp_json = new Services_JSON(); 71 } 72 73 return $wp_json->encodeUnsafe( $string ); 74 } 75 } 76 77 if ( !function_exists('json_decode') ) { 78 function json_decode( $string, $assoc_array = false ) { 79 global $wp_json; 80 81 if ( !is_a($wp_json, 'Services_JSON') ) { 82 require_once( ABSPATH . WPINC . '/class-json.php' ); 83 $wp_json = new Services_JSON(); 84 } 85 86 $res = $wp_json->decode( $string ); 87 if ( $assoc_array ) 88 $res = _json_decode_object_helper( $res ); 89 return $res; 90 } 91 function _json_decode_object_helper($data) { 92 if ( is_object($data) ) 93 $data = get_object_vars($data); 94 return is_array($data) ? array_map(__FUNCTION__, $data) : $data; 95 } 96 }
Note: See TracChangeset
for help on using the changeset viewer.