/** * when load each widget in sidebars * @wp_hook action wp_register_sidebar_widget * @param $widget Widget instance */ public function _wp_register_sidebar_widget($widget) { //_print($widget); $wd = isset($widget['callback'][0]) ? $widget['callback'][0] : null; //setup features for certain widgets if ($wd instanceof WP_Widget && is_active_widget(false, false, $wd->id_base) && class_exists('APF_WidgetFeatures')) { APF_WidgetFeatures::setup_features_widgets($wd); } }
/** * @param $slug * @param $tab * @param $setting */ public static function init($slug, $tab, $setting) { $tab['slug'] = $slug; self::$setting = $setting; self::$setting_tab = $tab; add_action('load_' . $setting::HW_SETTINGS_PAGE . '_' . $setting::valid_tab_slug($slug), __CLASS__ . '::replyToAddFormElements'); }