Skip to content

Instantly share code, notes, and snippets.

@katpadi
Created August 8, 2014 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katpadi/aee1bee918f98a157e49 to your computer and use it in GitHub Desktop.
Save katpadi/aee1bee918f98a157e49 to your computer and use it in GitHub Desktop.
Sample
<?php
class TitanStuff {
function __construct( ) {
$this->init();
}
function init() {
$this->titan = TitanFramework::getInstance( '_s' );
$this->_sAdminPanel();
$this->_sAdminOptions();
}
function _sAdminPanel() {
$this->panel = $this->titan->createAdminPanel( array(
'name' => 'Theme Options',
'parent' => 'options-general.php',
) );
}
function _sAdminOptions() {
$this->panel->createOption( array(
'name' => 'My Text Option',
'id' => 'my_text_option',
'type' => 'text',
'desc' => 'This is our option'
) );
$this->panel->createOption( array(
'name' => 'My Select Option',
'id' => 'my_select_option',
'type' => 'select',
'options' => array(
'1' => 'Option one',
'2' => 'Option two',
'3' => 'Option three',
),
'desc' => 'This is a select drop down box',
'default' => '2',
) );
$this->panel->createOption( array(
'type' => 'save'
) );
}
}
new TitanStuff();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment