These fields do not store values. They control the admin UI layout and organization.
| Field Type | Purpose | Template Code |
|---|---|---|
| Tab | Starts a labelled section in the editor; the fields after it, up to the next Tab or Accordion, appear under its heading | None needed |
| Accordion | Starts a labelled section in the same way; the heading does not collapse anything | 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. In the post editor a Tab or an Accordion is a heading with its fields under it: nothing switches and nothing collapses. On an options page none of the three types is shown.
// 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' ] ],
],
] );—