Multi-Optional Field Source Settings
Multi-optional fields are those that allow the user to choose one or several options from the ready-made list – Select, Radio, and Checkbox Fields. Those three fields have a similar settings window where you can choose the source of the options that will be available for the users.
Fill Options From
When you choose this variant, you’ll be able to add the options to the list by hand. Click the “Manage Items” button.
You will see the option creation and editing window.
Let’s go through the available features:
Safe deleting. When this toggle is turned on, you will be getting a notification message whenever trying to delete the option. That message will ask you if you are sure about deleting an item.
“Show/Hide” button. It is the button with the eye-shaped icon. By default, it is in the “show” mode. If you click on it, the icon will change to the eye crossed by the line, and the option will fold. Clicking on it again will unfold the option.
“Clone” button. Creates a copy of the created option underneath.
“Delete” button. Deletes the item.
Label. This is the name of the option that is shown to the user in the list.
Value. The inner data, the value that corresponds to the option. Be aware that if you leave this bar empty, the option will not be saved. Only the options that have some value will become visible in the list.
Calculate. The value from this bar will be taken to the formula, which is calculated by the Calculated Field.You can add as many options to the list as you need by clicking the “Add New Option” button. When you are done with the options list, press the “Update” button.
This type of source allows you to choose the data from the post or page’s meta field to automatically create the list of options. For example, you can create a list of the post titles. If you create a custom post type and custom meta fields via the plugins like JetEngine or ACF, you will be able to choose them here, too.
Post Type. In this drop-down list, you can choose where the items will be taken. Those can be default WordPress Posts, Pages and Media, or the custom post types if you have them. The list will be formed of those posts, pages, or media items names.
Value from meta field. By default, when you choose the Post Type, the values of the options will be taken from post or page IDs. However, in this bar, you can specify the name of the concrete meta field from which the value will be pulled. Be aware that this will work with the custom meta fields only.
Calculated value from meta field. If you use Calculated Field and add this Select Field to the formula, the value for it will be taken from this bar. You can choose a meta field here that will be different from the one mentioned in the Value from meta field bar.
Use this type of source if you want to build a list from the categories or taxonomies you’ve created. For example, if you use the WooCommerce plugin, you can create a list of product categories in the Select or Radio Field. And if you use such plugins as ACF or JetEngine and had a custom taxonomy, you can create a list of it, too.
Taxonomy. Here you select the type of taxonomy that will be used to create a list. Besides the default WordPress Categories, you can also select Tags, Navigation Menus, Link Categories, and Formats. If you have created a custom taxonomy for your posts, it will also be listed in this drop-down. The names of the taxonomy items will be used as labels in the list.
Value from meta field. By default, the term IDs are used as the values for the list items. If you want to take the values from a custom meta field added to the taxonomy instead, type its name into this bar.
Calculated value from meta field. The value that will be used in the Calculated Field formula can differ from its normal value. If you need it, type in the name of the custom meta field that is to be pulled the values for calculations from.
A custom meta field data can also be used to create an options list. The information for each of the posts will be different and you can show it separately from the posts the meta fields are attached to. Be aware that this type of source allows you to display only the values of the custom meta fields, created with plugins like JetEngine or ACF.
Type the name of the meta field to the Meta field to get value from bar. The values of the meta field will be used as calculated values, too.
This source can create two types of dynamically generated lists. In this case, “dynamically generated” means that it is not taken from the meta fields. The list is created by one of the generator functions you choose.
Generator Function. It defines the rules of options list generation.
- Numbers Range – creates a range of numbers from 1 to the number that is stored in the meta field you define in the Field Name bar. For example, you have a meta field “Available items” and for the post where the form is placed, it has a value of 5. In this case, the Numbers Range will create a list, containing numbers from 1 to 5;
- Get values list from database – after you enter the meta key to the Field Name bar, this function searches the database and shows the list of values of every position with a matching key. Be aware that you have to create database fields with that key before using this function.
Value from meta field. You place the name of the meta field to the Field Name bar, and that meta field is attached to some post type. The IDs of that post type items are used, by default, as the values of the list options. But you can choose another meta field to take values from and type its name here.
Calculated value from meta field. Paste the name of the meta field into this bar, and its values will be used for Calculated Field formulas.
- Get values list from JetEngine Query — creates a list of options based on the query results of the custom query, built in the Query Builder tool of the JetEngine plugin. This option gets values from any type of custom query (post query, terms query, etc.). For example, you have built a custom query of the Users Query type that filters down the list of users by a custom meta field. You can use this query to generate a list of queried users as options for the multi-optional fields. Mind that this generator function requires installed the JetEngine plugin.
In the Field Name bar, specify the ID of the custom query, property to get values from, property to get labels from, and property to get calculated value from. If you use Posts Query and you do not need to use a calculated value, you may just set the query ID. An example for the Posts Query:
- 47 is the ID of the custom query.
- ID is the property that provides values.
- post_title is the property that provides labels.
- post_author is the property that provides calculated values.
The generator takes the following parameters:
Values, labels, and calculated values can be filtered:
In this case, $this->additional is args_additional parameter.
Switch page on change
If you want the page to switch when the user selects one of the variants from the select list, turn this toggle on. Keep in mind that to make it work, you have to create the next page of the form, which will be shown after changes in the select.