wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



rest_is_object › WordPress Function

Da5.5.0
Deprecaton/a
rest_is_object ( $maybe_object )
Parametri:
  • (mixed) $maybe_object The value being evaluated.
    Richiesto:
Ritorna:
  • (bool) True if object like, otherwise false.
Definito a:
Codex:

Determines if a given value is object-like.



Sorgenti

function rest_is_object( $maybe_object ) {
	if ( '' === $maybe_object ) {
		return true;
	}

	if ( $maybe_object instanceof stdClass ) {
		return true;
	}

	if ( $maybe_object instanceof JsonSerializable ) {
		$maybe_object = $maybe_object->jsonSerialize();
	}

	return is_array( $maybe_object );
}