-
Notifications
You must be signed in to change notification settings - Fork 123
Post select field
mattheu edited this page Apr 28, 2013
·
12 revisions
Post select field. Displays a select input allowing the user to select a post.
Use the 'query' argument to modify the posts that will be available as options. See the documentation on WP Query for more information.
If the 'use_ajax' argument is set to true, the options are populated by an AJAX request when the select field is first clicked.
Uses Select2, a jQuery based replacement for select boxes.
- id (string) (required)
- type 'post_select' (required)
- name (string) Field display name. Used as field label.
- desc (string) Field description. Displayed below label.
- query (array) WP_Query args.
- use_ajax (bool)
- repeatable (bool)
- cols (int) [1-12]
array(
'id' => 'example-field-post-select',
'name' => 'Post Select Field',
'type' => 'post_select',
'use_ajax' => true,
'query' => array(
'cat' => 8
)
);
- Setup/Install Custom Meta Boxes
- Creating a custom meta box
- Displaying Field Data
- Optional Generic Field Args
- Repeatable Fields
General
- Text Field
- Small Text Field
- Number Field
- URL Field
- Textarea Field
- Code Field
- Select Field
- Checkbox Input Field
- Radio Input Field
Date & Time
WordPress
Media
Utilities