mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Add doc blocks to functions that are missing them.
If the function has no need for `@param` or `@return`, do an archeaological dig to find `@since`. See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32672 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -195,6 +195,12 @@ if ( !function_exists('json_encode') ) {
|
||||
}
|
||||
|
||||
if ( !function_exists('json_decode') ) {
|
||||
/**
|
||||
* @global Services_JSON $wp_json
|
||||
* @param string $string
|
||||
* @param bool $assoc_array
|
||||
* @return object|array
|
||||
*/
|
||||
function json_decode( $string, $assoc_array = false ) {
|
||||
global $wp_json;
|
||||
|
||||
@@ -208,6 +214,11 @@ if ( !function_exists('json_decode') ) {
|
||||
$res = _json_decode_object_helper( $res );
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object $data
|
||||
* @return array
|
||||
*/
|
||||
function _json_decode_object_helper($data) {
|
||||
if ( is_object($data) )
|
||||
$data = get_object_vars($data);
|
||||
|
||||
Reference in New Issue
Block a user