Post type select
Post type select field renders a searchable Select 2 field that will provide a list of post type titles when a user has typed at least two characters (the values will be loaded dynamically). Similar to the Datalist field. Supports multiple choice.
Description
The field uses AJAX to load the values dynamically, so depending on your configuration, there may be some latency before the results are presented to the user. Uses the Search Parameter of the WP_Query
class on the back end.
Example configuration
This will produce the following
Multiple choice
if 'multiple' => true
is added to the configuration object, the field will respect it. The following configuration
will result in the following
Params
Name | Type | Description |
| string |
|
| string | Unique ID that will be used to retrieve the value (required) |
| string | Specifies in which tab this option will be rendered |
| string | Shows a heading to the left of the field |
| string | Shows a description text (can have HTML) |
| boolean | Set to |
| string | Post type (standard or custom) to search for. If not specified, searches posts of the |
Last updated