function __construct() { parent::__construct(); $this->registerStyles('moztheme2011'); $this->registerFilter('body_class', 'filterSingular', 100); if ($this->isOptionSet('enable-custom-colors') || $this->isOptionSet('embed-custom-css')) { $this->registerAction('wp_head', 'embedStyles'); } if ($this->isOptionSet('sidebar-post') || $this->isOptionSet('sidebar-page')) { $this->registerAction('get_footer', 'addSidebar'); $this->registerAction('get_sidebar', 'inSidebar'); } if ($this->isOptionSet('headline')) { $this->registerFilter('the_title', 'addHeadline', 10, 2); $this->registerFilter('post_class', 'addHeadlineClass'); } if ($this->isOptionSet('image-size')) { $this->registerFilter('twentyeleven_header_image_height', 'getHeaderImageHeight'); if ($this->isOptionSet('force-image-size')) { wp_enqueue_script("jquery"); $this->registerAction('wp_head', 'embedScript'); } } if (is_user_logged_in()) { $this->registerAction('wp_before_admin_bar_render', 'addThemeMenuItems'); } }
/** * Base class constructor. */ protected function __construct() { parent::__construct(); if ($this->ajaxRequest) { $this->initAjax(); } else { register_activation_hook(__FILE__, $this->fn('pluginActivation')); register_deactivation_hook(__FILE__, $this->fn('pluginDeactivation')); $this->init(); } }