bp_core_add_contextual_help

Adds contextual help to BuddyPress admin pages.

Description

bp_core_add_contextual_help( (string) $screen = '' ); 

Parameters (1)

0. $screen — Optional. (string) => ''
Current screen.

Usage

  1. if ( !function_exists( 'bp_core_add_contextual_help' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-functions.php'; 
  3.  
  4. // Current screen. 
  5. $screen = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_add_contextual_help($screen); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-functions.php  
  1. function bp_core_add_contextual_help( $screen = '' ) { 
  2.  
  3. $screen = get_current_screen(); 
  4.  
  5. switch ( $screen->id ) { 
  6.  
  7. // Component page. 
  8. case 'settings_page_bp-components' : 
  9.  
  10. // Help tabs. 
  11. $screen->add_help_tab( array( 
  12. 'id' => 'bp-comp-overview',  
  13. 'title' => __( 'Overview', buddypress ),  
  14. 'content' => bp_core_add_contextual_help_content( 'bp-comp-overview' ),  
  15. ) ); 
  16.  
  17. // Help panel - sidebar links. 
  18. $screen->set_help_sidebar( 
  19. '<p><strong>' . __( 'For more information:', buddypress ) . '</strong></p>' . 
  20. '<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/">Managing Components</a>', buddypress ) . '</p>' . 
  21. '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', buddypress ) . '</p>' 
  22. ); 
  23. break; 
  24.  
  25. // Pages page. 
  26. case 'settings_page_bp-page-settings' : 
  27.  
  28. // Help tabs. 
  29. $screen->add_help_tab( array( 
  30. 'id' => 'bp-page-overview',  
  31. 'title' => __( 'Overview', buddypress ),  
  32. 'content' => bp_core_add_contextual_help_content( 'bp-page-overview' ),  
  33. ) ); 
  34.  
  35. // Help panel - sidebar links. 
  36. $screen->set_help_sidebar( 
  37. '<p><strong>' . __( 'For more information:', buddypress ) . '</strong></p>' . 
  38. '<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/#settings-buddypress-pages">Managing Pages</a>', buddypress ) . '</p>' . 
  39. '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', buddypress ) . '</p>' 
  40. ); 
  41.  
  42. break; 
  43.  
  44. // Settings page. 
  45. case 'settings_page_bp-settings' : 
  46.  
  47. // Help tabs. 
  48. $screen->add_help_tab( array( 
  49. 'id' => 'bp-settings-overview',  
  50. 'title' => __( 'Overview', buddypress ),  
  51. 'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ),  
  52. ) ); 
  53.  
  54. // Help panel - sidebar links. 
  55. $screen->set_help_sidebar( 
  56. '<p><strong>' . __( 'For more information:', buddypress ) . '</strong></p>' . 
  57. '<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/#settings-buddypress-settings">Managing Settings</a>', buddypress ) . '</p>' . 
  58. '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', buddypress ) . '</p>' 
  59. ); 
  60.  
  61. break; 
  62.  
  63. // Profile fields page. 
  64. case 'users_page_bp-profile-setup' : 
  65.  
  66. // Help tabs. 
  67. $screen->add_help_tab( array( 
  68. 'id' => 'bp-profile-overview',  
  69. 'title' => __( 'Overview', buddypress ),  
  70. 'content' => bp_core_add_contextual_help_content( 'bp-profile-overview' ),  
  71. ) ); 
  72.  
  73. // Help panel - sidebar links. 
  74. $screen->set_help_sidebar( 
  75. '<p><strong>' . __( 'For more information:', buddypress ) . '</strong></p>' . 
  76. '<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/extended-profiles/">Managing Profile Fields</a>', buddypress ) . '</p>' . 
  77. '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', buddypress ) . '</p>' 
  78. ); 
  79.  
  80. break;