Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Removes the default contextual help panel tabs and adds our custom help tab. Contents for our custom tab are assumed
- * to be contained in a directory names "views" in a file named "sampleHelp.html". Adjust as needed
- *
- * @param $strOldHelp string
- * @param $intScreenID integer
- * @param $objScreen object
- * @return string
- */
- function mizzouAdjustHelpScreen($strOldHelp,$intScreenID,$objScreen)
- {
- // we only want to adjust the help contents when working on the default post type
- if($objScreen->post_type == 'post'){
- // we only want to adjust the help contents if we can load our custom help contents
- if (FALSE !== $strHelpContents = file_get_contents(dirname(__FILE__).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'sampleHelp.html')) {
- //get rid of all the default help tabs in the contextual help panel
- $objScreen->remove_help_tabs();//get rid of all the help tabs
- //remove the help panel sidebar
- $objScreen->set_help_sidebar('');
- //add our custom help tab
- $objScreen->add_help_tab(array(
- 'id' => 'sample_help_tab',
- 'title' => 'Sample Help Tab',
- 'content' => $strHelpContents,
- ));
- }
- }
- return $strOldHelp;
- }
- add_filter('contextual_help','mizzouAdjustHelpScreen',10,3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement