RepeaterItem

Class.

use WebCodingCat\WpAppFramework\Block\RepeaterItem;

One item of a repeater (Repeater): the inner blocks rendered for a post, term, comment, user or row. Print the content in the element marked with repeater_item():

{% for item in items %}<li{{ repeater_item(item) }}>{{ item.content|raw }}</li>{% endfor %}

In renders for the block editor the content is empty: the editor shows the inner blocks itself.

Methods

getContent()

getContent(): string

The inner blocks rendered for the item, as HTML.

Returns string

getContext()

getContext(): array

The block context of the item, e.g. ['postId' => 12, 'postType' => 'post'].

Returns array<string, int|string>