From a2c3ed2d98387465da7e3497f92255799fffbcd0 Mon Sep 17 00:00:00 2001
From: Steve Sutton
Date: Fri, 7 Jul 2017 11:44:41 -0400
Subject: [PATCH] Update the help tab function for other plugins.
Adding any other help tabs from other plugins into import help.
---
setup/adminHooks.php | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/setup/adminHooks.php b/setup/adminHooks.php
index 0f8c9aa5..d9ab22f4 100644
--- a/setup/adminHooks.php
+++ b/setup/adminHooks.php
@@ -291,8 +291,15 @@ function glm_import_add_page() {
}
/**
-https://codex.wordpress.org/Adding_Contextual_Help_to_Administration_Menus
-https://codex.wordpress.org/Class_Reference/WP_Screen/add_help_tab
+ * glm_admin_import_help_tab
+
+ * Add help tab for the Import CSV sub page.
+ * For info these two url's go over the wordpress codex for them.
+ * https://codex.wordpress.org/Adding_Contextual_Help_to_Administration_Menus
+ * https://codex.wordpress.org/Class_Reference/WP_Screen/add_help_tab
+ *
+ * @access public
+ * @return void
*/
function glm_admin_import_help_tab () {
$screen = get_current_screen();
@@ -342,6 +349,11 @@ function glm_admin_import_help_tab () {
for the file.' ) . '
'
)
);
+ // Get help tabs from the other plugins using apply_filters.
+ $helpTabs = apply_filters( 'glm-member-db-add-help-for-import', array() );
+ foreach ( $helpTabs as $newTab ) {
+ $screen->add_help_tab( $newTab );
+ }
// Help sidebars
// $screen->set_help_sidebar(
// '' . __( 'For more information:' ) . '
' .
--
2.17.1