Add help docs feature/helpDocs
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 4 Aug 2016 20:18:28 +0000 (16:18 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 4 Aug 2016 20:18:28 +0000 (16:18 -0400)
Testing getting some help stuff setup for a plugin.
A good start.

setup/adminMenus.php

index 33e395f..e7822b1 100644 (file)
@@ -51,7 +51,7 @@
  */
 
 // Add Leads sub-menu for GLM Associate menu
-add_submenu_page(
+$glm_leads_page_sufix = add_submenu_page(
     'glm-members-admin-menu-members',
     'Leads',
     'Leads',
@@ -59,7 +59,31 @@ add_submenu_page(
     'glm-members-admin-menu-leads-index',
     function() {$this->controller('leads');}
 );
+if ( $glm_leads_page_sufix ) {
+    add_action( 'load-' . $glm_leads_page_sufix, function(){
+        $screen = get_current_screen();
+        $screen->add_help_tab(
+            array(
+                'id'      => 'glm-member-db-leads-help-search',
+                'title'   => __( 'Search for Leads' ),
+                'content' => '<p>After the search if there\'s results you\'ll get a download link.</p>'
+            )
+        );
+        $screen->add_help_tab(
+            array(
+                'id'      => 'glm-member-db-leads-help-bysource',
+                'title'   => __( 'Search for Leads By form' ),
+                'content' => '<p>Select a form or source from the drop down called \'Source\'</p>'
+            )
+        );
 
+        // Help sidebars.
+        $screen->set_help_sidebar(
+            '<p><strong>' . __( 'For more information' )  . '</strong></p>'.
+            '<p><a href="http://www.gaslightmedia.com/">Gaslight Media Website</a></p>'
+        );
+    } );
+}
 // If a contact is logged in (ownEntity isn't false), add Contact Profile menu item
 if ( $this->config['loggedInUser']['contactUser'] ) {
     add_submenu_page(