REST API: add JsonSerializable() compatibility interface for PHP <5.4 to compat.php

Props rmmcue.
See #33982.


git-svn-id: https://develop.svn.wordpress.org/trunk@34845 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-10-06 02:55:43 +00:00
parent 51b4e75afb
commit d2bb4d6745

View File

@ -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();
}
}