wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



rest_is_object › WordPress Function

Od5.5.0
Przestarzałyn/a
rest_is_object ( $maybe_object )
Parametry:
  • (mixed) $maybe_object The value being evaluated.
    Wymagane: Tak
Powrót:
  • (bool) True if object like, otherwise false.
Zdefiniowane na:
Codex:

Determines if a given value is object-like.



Źródło

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