function __construct($args = array()) { if (!function_exists('my_t_define_constants')) { die('Theme constants not defined.'); } parent::__construct(); // default self::$assets_path = MY_BASEPATH . DS . 'assets'; self::$assets_url = MY_BASEURL . '/' . 'assets'; self::$widgets_path = MY_BASEPATH . DS . 'widgets'; self::$feeds_path = MY_BASEPATH . DS . 'feeds'; self::$admin_path = MY_BASEPATH . DS . 'admin-pages'; self::$builds_path = MY_BASEPATH . DS . 'builds'; self::$tools_path = MY_BASEPATH . DS . 'tools'; // custom overrides + dynamic property declarations // this allows use to save some space foreach ($args as $key => $value) { if (property_exists($this, $key) or $this->is_switch_var($key)) { $this->{$key} = $value; } } $this->assets = new MY_Theme_Assets(array('handle' => self::$assets_path, 'url' => self::$assets_url)); $this->check_dependencies(); $this->check_phpversion(); $this->check_activation(); $this->add_wp_hooks(); if (MY_ISADMIN) { add_action('admin_menu', array($this, 'add_admin_pages'), 1); // add first b/c we're important } // TODO - do admin $this->save_plugins_list(); // outsource data sanitizing // wp-post/query interface, request var handling $this->template = new StdClass(); }