public static function bootstrap() { // Kill the defaults remove_action('bbp_new_reply', 'bbp_notify_subscribers', 11); if (is_admin()) { Falcon_Admin::bootstrap(); } try { // Check for a handler first self::$handler = self::get_handler(); // Then add our own hooks! self::register_hooks(); } catch (Exception $e) { add_action('all_admin_notices', function () use($e) { printf('<div class="error"><p>' . __('Problem setting up Falcon! %s', 'bbsub') . '</p></div>', $e->getMessage()); }); } foreach (self::get_available_connectors() as $key => $connector) { self::$connectors[$key] = new $connector(self::$handler); } }
public static function settings_section_handler() { if (!self::$registered_handler_settings) { self::register_handler_settings_fields('bbsub_options', 'bbsub_options_handleroptions'); self::$registered_handler_settings = true; } if (!defined('DOING_AJAX') || !DOING_AJAX) { echo '<div id="bbsub-handlersettings-insert"></div>'; } global $wp_settings_fields; // If the handler didn't register any options, don't bother to print the // title for the section $page = 'bbsub_options'; $section = 'bbsub_options_handleroptions'; if (!isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section])) { return; } echo '<div id="bbsub-handlersettings-header">'; echo '<h3 id="bbsub-handlersettings-title">' . __('Handler Settings', 'falcon') . '</h3>'; try { $handler = Falcon::get_handler_class(); } catch (Exception $e) { return; } $handler::options_section_header(); echo '</div>'; }