-
-
Notifications
You must be signed in to change notification settings - Fork 0
Docs Containers & Options
Titan Framework is very simple and revolves around just 2 concepts:
- Containers
- Options
To use the framework, you just have to create containers, then put options into them. That’s it!
Containers are basically your admin pages, tabs, meta boxes, and theme customiser sections. These are essentially the areas where you put your options.
$titan = TitanFramework::getInstance( 'my-theme-or-plugin-name' );
// Create an admin page with a menu
$panel = $titan->createAdminPanel( array(
'name' => 'Theme Options',
) );
// Create an admin tab inside the admin page above
$tab = $panel->createTab( array(
'name' => 'General Options',
) );
// Create a meta box
$box = $titan->createMetaBox( array(
'name' => 'My Meta Box',
) );
// Create a theme customizer section
$section = $titan->createThemeCustomizerSection( array(
'name' => 'My Section',
) );
Options are the input fields which serve as the settings to your theme or plugin. Options are valuable tools for any theme or plugin, and extends its functionality by allowing the user to modify it to their hearts content.
Any of the above containers have a createOption
function that can be used to create an option:
$titan = TitanFramework::getInstance( 'my-theme-or-plugin-name' );
// Create an admin page with a menu
$panel = $titan->createAdminPanel( array(
'name' => 'Theme Options',
) );
// Create an option inside the admin page above
$panel->createOption( array(
'name' => 'My Option',
'id' => 'my_option1',
) );
// Create an admin tab inside the admin page above
$tab = $panel->createTab( array(
'name' => 'General Options',
) );
// Create an option inside the admin tab above
$tab->createOption( array(
'name' => 'My Option',
'id' => 'my_option2',
) );
// Create a meta box
$box = $titan->createMetaBox( array(
'name' => 'My Meta Box',
) );
// Create an option inside the meta box above
$box->createOption( array(
'name' => 'My Option',
'id' => 'my_option3',
) );
// Create a theme customizer section
$section = $titan->createThemeCustomizerSection( array(
'name' => 'My Section',
) );
// Create an option inside the customizer section above
$section->createOption( array(
'name' => 'My Option',
'id' => 'my_option4',
) );
Ajax Button Checkbox Code Color Custom Date EDD License Editor Enable File Upload Font Gallery Heading Iframe Multicheck Multicheck Categories Multicheck Pages Multicheck Post-Types Multicheck Posts Note Number Radio Radio Image Radio Palette Save Select Select Categories Select Pages Select Post-Types Select Posts Select Users Sortable Text Textarea Upload