Repeater Custom Meta Field Overview
From this overview, you will learn about the Repeater Meta Field from the JetEngine plugin and its general settings and features.
You can use the Repeater meta field to combine multiple contents of the same type. It helps to avoid plural separate meta fields. With the Repeater meta field, you can group and collapse contents for your convenience.
- A rent house with a description of facilities per floor;
- Tour plans where each repeater item is a day of the program of the tour;
- Team Member experience etc.
Decide where you need the repeater field. You can create it for posts, custom content type items, users, options pages, and products.
So let’s start with the main settings:
- Label — the label you see in the back end of the post, user, etc., side by your field. It can consist of different characters;
- Name/ID — field name/key which will be stored in the database. It should contain only Latin letters, lower case, numbers, `-` or `_` as symbols;
- Object type — here, “Field” should be selected;
- Field type — the list of available fields. Pick the “Repeater” option;
Press the “New Repeater Field” button to add repeater item fields. Here, you can read about meta field types.
Rules for the Label and Name are the same. Now, let’s look at the following repeater settings.
- Collapsed — toggle this option to collapse repeater item fields on the page load;
- Title Field — pick a repeater item field to show as a repeater item title (the one you created as a nested meta field);
- Description — add a small description for your convenience or for other users who will have access to the website’s back end;
- Is Required — switcher that defines whether its field is required to create/update post/user/item;
- Show in Rest API — toggle to be activated to make this field visible with WordPress Rest API and available to edit.
- Conditional Logic — set meta field display rules.
Now click the “Save Changes” button and navigate to the source of your Repeater field. In the described case, it’s User experience. Click the “New Item” button to see your fields and create as many items as you need.
Repeater Meta Field Sources
The Repeater field is saved as an array and requires specific display methods.
For example, filled-in repeater meta field:
Repeater meta field PHP value: repeater value is an associative array with keys like “item-0”, “item-1”, etc., and values being an array of repeater item fields.
The Repeater field is also serialized to be stored in the Database.
Check the front-end view.
Options for Displaying Repeater Field
There are several ways you can display content from the Repeater meta field:
- Repeater Listing: available for posts, custom content type, options page, and Repeater Query type;
- Dynamic Repeater widget: works on the single post’s pages or in the listings as a Nested listing;
- JetElements widgets: slider, carousel, timeline, accordion, tabs, etc., with Repeater Query type.
That’s all; now you know how the repeater meta field can be used, stored, and displayed on your WordPress website with the JetEngine plugin.