Update the help tab function for other plugins.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 7 Jul 2017 15:44:41 +0000 (11:44 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 7 Jul 2017 15:44:41 +0000 (11:44 -0400)
Adding any other help tabs from other plugins into import help.

setup/adminHooks.php

index 0f8c9aa..d9ab22f 100644 (file)
@@ -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.' ) .  '</p>'
         )
     );
+    // 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(
     //     '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .