Samples
Add code to your theme's functions.php.
Create an options page with 2 tabs
function add_custom_options_pages( $pages ) {
$myPages = array(
array(
'id' => 'my-options-page',
'name' => 'My options page',
'tabs' => array(
array(
'id' => 'main',
'name' => 'Main',
),
array(
'id' => 'inner',
'name' => 'Inner',
),
),
),
);
return array_merge( $pages, $myPages );
}
add_filter( 'alch_options_pages', 'add_custom_options_pages' );Simple text field
The following will add a text field to the 'My options page'. If you don't specify a tab the field is going to render in each of them.
To restrict the field to a particular tab use the tab key.
With a repeater field in one of two tabs
Network options
The config is almost exactly the same as for regular options, only you should use the alch_network_options action instead of alch_options. E.g.
Last updated