Scenario: You find yourself opening and closing the loop browser to check the available keys you can use, and you think to yourself, “There has to be an easier way.” There is — the .keys() modifier.
The .keys() gives you a faster way to do the same thing directly in your loop/template, especially when you want to inspect a specific nested object without scanning through the full JSON tree.
The syntax is basic — object.keys()
{this.keys()}
{this.acf.keys()}
{item.metabox.keys()}Just use the modifier with any object, at the root level or on a nested object. Here are a couple of examples:


Share Your Thoughts