Example #1
0
 /**
  * Add a term to the theme options panel.
  *
  * @param array $configs Array containing all configurations
  * @param array $contents Contains all data
  *
  * @since 3.3.4
  */
 public function addTerm($configs = array())
 {
     //Check if we are in admin panel
     if (empty($configs) || !isset($configs['slug']) || empty($configs['slug'])) {
         return;
     }
     //Define the slug
     $configs['slug'] = TeaThemeOptions::getUrlize($configs['slug']);
     $slug = $configs['slug'];
     //Check if slug has already been registered
     if (isset($this->terms[$slug]) && !empty($this->terms[$slug])) {
         return;
     }
     //Define cpt configurations
     $this->terms[$slug] = $configs;
 }
Example #2
0
 /**
  * Constructor.
  *
  * @param string $identifier Define the main slug
  *
  * @since 3.1.0
  */
 public function __construct($identifier)
 {
     //Admin panel
     if (!TTO_IS_ADMIN) {
         return;
     }
     //Initialize all default configurations
     $identifier = trim($identifier);
     $this->identifier = TeaThemeOptions::getUrlize($identifier);
     //Get current page and section
     $this->currentPage = isset($_REQUEST['page']) ? (string) $_REQUEST['page'] : '';
     $this->currentSection = isset($_REQUEST['section']) ? (string) $_REQUEST['section'] : '';
     //Initialize
     $this->initialize();
     //Update contents
     add_filter('tto_template_special_pages', array(&$this, 'hookTemplateSpecial'), 10, 2);
     add_filter('tto_menu_settings-global_contents', array(&$this, 'hookMenuContentsGlobal'));
     add_filter('tto_menu_settings-modules_contents', array(&$this, 'hookMenuContentsModules'));
 }