rest_is_object

The timeline below displays how wordpress function rest_is_object has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Determines if a given value is object-like.
 *
 * @since 5.5.0
 *
 * @param mixed $maybe_object The value being evaluated.
 * @return bool True if object like, otherwise false.
 */
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);
}