Alchemy Options Docs
v1.0
v1.0
  • Read Me
  • Installation
  • Configuration
  • Meta Boxes
  • Samples
  • Field types
    • Text
    • Password
    • URL
    • Email
    • Tel
    • Textarea
    • Editor (WYSIWYG)
    • Datepicker
    • Image upload
    • Radio buttons
    • Select
    • Checkbox
    • Colorpicker
    • Image radio
    • Post type select
    • Datalist
    • Sections
    • Repeater
    • Button group
    • Slider
    • Taxonomy select
    • Field group
  • Functions
    • alch_options_id
    • alch_network_options_id
    • alch_get_option
    • alch_get_network_option
    • alch_delete_value
    • alch_get_post_meta
  • Javascript
    • getOption
    • getNetworkOption
    • getPostMeta
  • Filters
    • alch_options_id
    • alch_default_page_capabilities
    • alch_default_page_icon
    • alch_default_page_position
    • alch_network_options_id
    • alch_options_id() . '_args'
    • alch_network_options_id() . '_args'
    • alch_allowed_editor_html_tags
    • alch_allowed_editor_protocols
    • alch_{ $optionsPageID }_capabilities
    • alch_{ $optionsPageID }_icon
    • alch_{ $optionsPageID }_position
    • alch_value_{ $optionID }
    • alch_network_value_{ $optionID }
Powered by GitBook
On this page
  • Example configuration
  • Description
  • Params
  1. Field types

Sections

Sections field groups the fields into togglable sections. This field type is just for stylistic purposes, it means that it can be introduced later without breaking the existing fields.

Example configuration

...
array(
    'tab' => 'main',
    'type' => 'sections',
    'sections' => array(
        array(
            'title' => 'Section one',
            'options' => array(
                array(
                    'title' => 'My text field title',
                    'id' => 'text-option',
                    'desc' => 'Short description for the field',
                    'type' => 'text',
                ),
            ),
        ),
        array(
            'title' => 'Section two',
            'options' => array(
                array(
                    'title' => 'My textarea field title',
                    'id' => 'textarea-option',
                    'desc' => 'Short description for the field',
                    'type' => 'textarea',
                ),
            ),
        ),
    ),
),
...

This will produce the following

Description

Each section in the sections array should have the title and the options array. The options should consist of regular fields configurations (you may omit the tab key in each option though, since it'll be enough to mark the sections field itself).

You won't be able to get all values of a section at once, so strictly speaking, the Sections field is more of a wrapper than a field.

Params

Name

Type

Description

type

string

sections (required)

sections

array

tab

string

Specifies in which tab this option will be rendered

PreviousDatalistNextRepeater

Last updated 6 years ago

Unlike other grouping fields, such as or , where the IDs of the fields in groups could be used multiple times, this type requires that all the options were like regular options with unique IDs.

For these reasons, the Sections field cannot be used within the and .

An array of sections, each containing the title and options keys. See for more details. (required)

Field Group
Repeater
Repeater
Field Group
description