wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



rest_is_object › WordPress Function

Desde5.5.0
Obsoleton/a
rest_is_object ( $maybe_object )
Parâmetros:
  • (mixed) $maybe_object The value being evaluated.
    Required: Yes
Retorna:
  • (bool) True if object like, otherwise false.
Definido em:
Codex:

Determines if a given value is object-like.



Fonte

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