Custom fields
Register custom fields metabox and edit associated post type, options and fields.
Meta box options:
- Meta box title: Title of the meta box with custom fields group.
- Associated post type: Post type with which the meta box and custom fields should be associated. Only one meta box for post type is allowed.
- Meta box context: The context within the screen where the box should display. Available contexts vary from screen to screen.
- Meta box priority: The priority within the context where the box should show.
Custom field options:
- Custom field label: Label of the custom field input in meta box.
- Custom field key: Key name of the custom field, used to display the field value on the front end. Will be sanitized. It is recommended to use post type as a prefix. Add an underscore in first place to make this custom field private and not shown in the admin UI. Leave blank to generate from post type & label.
- Type: Type of input for this custom field. Available tpes: Text, Textarea, Number, Date, Color, Image / File, Select option, Checkbox list.
- Options list: Comma separated list of options for select and checkboxes custom field types.
Option 1, Option 2, Option 3
On update:
Basic mode: New code will be generated to update the related PHP file. Related theme mod will be updated.
Advanced mode: Editor code will be used to update the related PHP file. Related theme mod will not be updated.
On reset:
No custom fields will be registered.
Related PHP file will reset to default template. Related theme mod will reset to default values.
How to use custom fields
To display the custom fields for each post, you have to use a template tag that customizes your theme.get_post_meta($post->ID, $field_key, true);
Private custom fields (with field key starting with underscore) will not be shown in the admin UI and visual builders.