Skip to content

Recursive reference in menu object #2071

@ramiroazar

Description

@ramiroazar

Expected behavior

The json_encode function should return a JSON encoded string of the menu object.

Actual behavior

The json_encode function returns a boolean with the value false.

The json_last_error function returns a constant with the value JSON_ERROR_RECURSION.

The var_dump function returns a menu property with the value *RECURSION* within every menu item.

Steps to reproduce behavior

json_encode(new Timber\Menu());

What version of WordPress, PHP and Timber are you using?

WordPress 5.2.3, PHP 7.2.9, Timber 1.11.0

How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)

WordPress plugin repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions