Post type select
Last updated
Last updated
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.
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.
This will produce the following
if 'multiple' => true
is added to the configuration object, the field will respect it. The following configuration
will result in the following
Name
Type
Description
type
string
post-type-select
(required)
id
string
Unique ID that will be used to retrieve the value (required)
tab
string
Specifies in which tab this option will be rendered
title
string
Shows a heading to the left of the field
desc
string
Shows a description text (can have HTML)
post-type
string
Post type (standard or custom) to search for. If not specified, searches posts of the post
type.