Created
January 21, 2015 18:05
-
-
Save gfargo/e71e06d320455444603e to your computer and use it in GitHub Desktop.
Easy function to add help tabs to WP Admin Pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'contextual_help', 'wptuts_contextual_help', 10, 3 ); | |
| function wptuts_contextual_help( $contextual_help, $screen_id, $screen ) { | |
| // Only add to certain screen(s). The add_help_tab function for screen was introduced in WordPress 3.3. | |
| if ( $screen_id == 'market-trends' || ! method_exists( $screen, 'add_help_tab' ) ) | |
| return $contextual_help; | |
| $screen->add_help_tab( array( | |
| 'id' => 'wptuts-overview-tab', | |
| 'title' => __( 'Updating', 'plugin_domain' ), | |
| 'content' => '<p>' . __( 'Some help text here', 'plugin_domain' ) . '</p>', | |
| )); | |
| return $contextual_help; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment