Is there a hook for add_help_tab and custom_post_types
-
I have a plugin that uses Custom Post Types, and I’d like to update my contextual help to use the add_help_tab function.
I have spent hours searching and can’t find anyone else trying to do this and sharing how they did it.
I’ve tried as many hooks as I could.
Here’s one example of what I’ve got that’s not working:
add_action('admin_head','wpd_help'); function wpd_help( $contextual_help ) { $screen = get_current_screen(); if ( $screen->id == 'dictionary' || $screen->id == 'edit-dictionary') { $screen->add_help_tab( array( '123', 'Title' ) ); } }
Here’s my old, working contextual help:
// Add documentation to relevant pages add_filter( 'contextual_help', 'wpd_help', 10, 3 ); function wpd_help( $contextual_help, $screen_id, $screen ) { if ( $screen_id == 'edit-dictionary' ) { // The main Dictionary edit screen (lists all entries) include( 'help/context-help.php' ); $contextual_help = null; } elseif ( $screen_id == 'dictionary' ) { // The add/edit Dictionary screen (for single entry) include( 'help/add-edit.php' ); $contextual_help = null; } elseif ( $screen_id == 'edit-types' ) { // The Type editing page include( 'help/entry-types.php' ); $contextual_help = null; } elseif ( $screen_id == 'edit-sections' ) { // The Section editing page include( 'help/entry-sections.php' ); $contextual_help = null; } return $contextual_help; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Is there a hook for add_help_tab and custom_post_types’ is closed to new replies.