/** * Initialize plugin * @return void */ static function init() { global $pagenow; self::$help_docs_dir[] = get_template_directory() . '/includes/help-docs'; self::$help_docs_img_url[] = get_template_directory_uri() . '/includes/help-docs/img'; self::$help_docs_dir = apply_filters('wp_contextual_help_docs_dir', self::$help_docs_dir); self::$help_docs_img_url = apply_filters('wp_contextual_help_docs_url', self::$help_docs_img_url); foreach (self::$tabs as $tab) { foreach ((array) $tab['page'] as $page) { self::$tabs_by_page[$page][] = $tab; if (count(self::$tabs_by_page[$page]) < 2) { add_action('load-' . $page, array(__CLASS__, 'add_tab_to_screen')); } } } }