Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // init action
- add_action('admin_menu','wm_install');
- // all things that have to happen when installed
- function wm_install() {
- // to be used in contextual help, make an array to set a text for each theme page (but one step at a time)
- global $wm_main_hook;
- // add to admin menu
- $wm_main_hook = add_theme_page( 'Widget Area Manager', 'Widget Area Manager', 'administrator', 'widget_area_manager', 'wm_area_manager_admin' );
- add_theme_page( 'Edit Sidebar', 'Edit Sidebar', 'administrator', 'widget_area_editor', 'wm_area_editor_admin' );
- add_theme_page( 'Edit Widget', 'Edit Widget', 'administrator', 'widget_html_editor','wm_edit_widget' );
- }
- // help for widget area manager
- function wm_help( $contextual_help, $screen_id, $screen ) {
- // to be used in contextual help
- global $wm_main_hook;
- $context_help = 'DEFAULT';
- if( $screen_id == $wm_main_hook ) {
- // set the text variable used for what i want to show up here
- $contextual_help = "<p>This plugin Widget Area Manager, has some limitations, because of the way sidebars are setup. Unfortunately, I had thought sidebar data was saved in the database, but it is not, just widget's are. ";
- $contextual_help .= "So this means, that I can not add/remove sidebars that are saved, into the database. So I have focused this plugin on being able to edit sidebars, and edit widgets, and then add/remove widgets to sidebars.</p>";
- }
- return $contextual_help;
- }
- // Add the contextual help to the theme page
- add_filter('contextual_help', 'wm_help', 10, 3);
- ?>
Add Comment
Please, Sign In to add comment