Configuration
Last updated
Last updated
Make sure you have Alchemy Options installed.
To create an Alchemy Options option page use the alch_options_pages
hook:
This will add an options page to the WordPress sidebar.
By default, top-level pages are added after the Appearance section, but you can filter the page position, as well as its capabilities and icon via respective hooks.
An Alchemy Options option page can have subpages, you can specify them in the subpages
array like so:
This adds an options page with a subpage to the WordPress sidebar.
By default, the top-level page gets duplicated as a subpage producing 2 identical page titles. You can modify them like so:
This will produce nicer page names without title duplication.
Notice that in order for it to work the top-level and subpage id
s should be the same.
To add options to Alchemy Options option pages use the alch_options
hook:
That's it, just add some options instead of /* options will go here */
and see them appear on the page.
If there's a need to split options into several groups, Alchemy Options has got you covered. You may add the tabs
section to the config that looks like this:
IDs of the tabs should be unique, these values will be used in configuring of each option with the tab
key. If no tab
key is found in the option's settings it will be rendered in each tab.
If there's a need to split options even further, there's a sections
type for visual splitting of fields into togglable sections and a field-group
type to group related fields together for an easier value retrieval.