These fields do not store values. They control the admin UI layout and organization.
| Field Type | Purpose | Template Code |
|---|---|---|
| Tab | Groups fields into tabs in the editor | None needed |
| Accordion | Groups fields into collapsible sections | None needed |
| Message | Displays a read-only message/instructions in the editor | None needed |
Layout fields are configured in the field group definition and affect only the WordPress admin interface. They have no output in templates. Use them to organize complex field groups into logical sections.
php
// Example: Creating a field group with tabs programmatically
FIELDFORGE_Field_Groups::instance()->create( [
'title' => 'Product Details',
'fields' => [
// Tab: General
[ 'key' => 'field_tab_general', 'label' => 'General', 'type' => 'tab' ],
[ 'key' => 'field_title', 'label' => 'Title', 'name' => 'product_title', 'type' => 'text' ],
[ 'key' => 'field_desc', 'label' => 'Description', 'name' => 'product_desc', 'type' => 'textarea' ],
// Tab: Pricing
[ 'key' => 'field_tab_pricing', 'label' => 'Pricing', 'type' => 'tab' ],
[ 'key' => 'field_price', 'label' => 'Price', 'name' => 'price', 'type' => 'number' ],
[ 'key' => 'field_sale', 'label' => 'Sale Price', 'name' => 'sale_price', 'type' => 'number' ],
// Tab: Media
[ 'key' => 'field_tab_media', 'label' => 'Media', 'type' => 'tab' ],
[ 'key' => 'field_gallery', 'label' => 'Gallery', 'name' => 'gallery', 'type' => 'gallery' ],
// Message field for instructions
[ 'key' => 'field_msg', 'label' => 'Note', 'type' => 'message', 'message' => 'Upload at least 3 product images.' ],
],
'location_rules' => [
[ [ 'param' => 'post_type', 'operator' => '==', 'value' => 'product' ] ],
],
] );—