mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
In PHP 5.0.0, is_a() became deprecated in favour of the instanceof operator. Calling is_a() would result in an E_STRICT warning.
In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no longer throw `E_STRICT` warnings. To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var instanceof WP_Class` calls. `instanceof` does not throw any error if the variable being tested is not an object, it simply returns `false`. Props markoheijnen, wonderboymusic. Fixes #25672. git-svn-id: https://develop.svn.wordpress.org/trunk@31188 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -65,7 +65,7 @@ if ( !function_exists('json_encode') ) {
|
||||
function json_encode( $string ) {
|
||||
global $wp_json;
|
||||
|
||||
if ( !is_a($wp_json, 'Services_JSON') ) {
|
||||
if ( ! ( $wp_json instanceof Services_JSON ) ) {
|
||||
require_once( ABSPATH . WPINC . '/class-json.php' );
|
||||
$wp_json = new Services_JSON();
|
||||
}
|
||||
@@ -78,7 +78,7 @@ if ( !function_exists('json_decode') ) {
|
||||
function json_decode( $string, $assoc_array = false ) {
|
||||
global $wp_json;
|
||||
|
||||
if ( !is_a($wp_json, 'Services_JSON') ) {
|
||||
if ( ! ($wp_json instanceof Services_JSON ) ) {
|
||||
require_once( ABSPATH . WPINC . '/class-json.php' );
|
||||
$wp_json = new Services_JSON();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user