registerActionHooks(); return $this; } /** * [registerActionHooks description] * @return [type] [description] */ public function registerActionHooks() { add_action('customize_register', array($this, 'customizer')); add_action('leapin_loc_on_main_header', array($this, 'getButtonOnHeader'), 9); return $this; } /** * [customiser description] * @return [type] [description] */ public function customizer($wp_customize) { $this->registerCustomizerSettings('features', $wp_customize); return; } public function registerCustomizerSettings($file_handle = '', $wp_customize) { require_once get_template_directory() . '/inc/features/customizer/' . sanitize_title($file_handle) . '.php'; return $this; } public static function getButtonOnHeader() { $inst = LEAPIN_Theme_Mod::get_instance(); $href = $inst->get(LEAPIN_IDs::$leapin_feature_hb_href, LEAPIN_Theme_Mod::$default_leapin_feature_hb_href); $target = $inst->get(LEAPIN_IDs::$leapin_feature_hb_link_target) ? '_blank' : '_self'; $label = sprintf('%s', $inst->get(LEAPIN_IDs::$leapin_feature_hb_label, LEAPIN_Theme_Mod::$default_leapin_feature_hb_label)); $label_sub = sprintf('%s', $inst->get(LEAPIN_IDs::$leapin_feature_hb_label_sub, LEAPIN_Theme_Mod::$default_leapin_feature_hb_label_sub)); $icon = $inst->get(LEAPIN_IDs::$leapin_feature_hb_icon, LEAPIN_Theme_Mod::$default_leapin_feature_hb_icon); if(leapin_is_mod_visible(LEAPIN_IDs::$leapin_feature_hb_hide, true)){ printf('%s%s', esc_url($href), $target, $icon , $label . $label_sub); } } } new LEAPIN_Features();