REST API: add `JsonSerializable()` compatibility interface for PHP <5.4 to `compat.php`
Props rmmcue. See #33982. Built from https://develop.svn.wordpress.org/trunk@34845 git-svn-id: http://core.svn.wordpress.org/trunk@34810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5a357a452f
commit
f8c3aca01c
|
@ -316,3 +316,19 @@ if ( ! function_exists( 'json_last_error_msg' ) ) :
|
|||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! interface_exists( 'JsonSerializable' ) ) {
|
||||
define( 'WP_JSON_SERIALIZE_COMPATIBLE', true );
|
||||
/**
|
||||
* JsonSerializable interface.
|
||||
*
|
||||
* Compatibility shim for PHP <5.4
|
||||
*
|
||||
* @link http://php.net/jsonserializable
|
||||
*
|
||||
* @since 4.4.0
|
||||
*/
|
||||
interface JsonSerializable {
|
||||
public function jsonSerialize();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34844';
|
||||
$wp_version = '4.4-alpha-34845';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue