Permalink
Browse files

add function to remove menu entries, working with WP3.1

  • Loading branch information...
1 parent 376e4a8 commit c737b97b6b55e7791aaf896a4ede51347a4f2379 @bueltge committed Jun 6, 2011
Showing with 11 additions and 4 deletions.
  1. +11 −4 remove-comments-absolute.php
@@ -131,10 +131,17 @@ public function remove_comments () {
}
// remove dashboard meta box for recents comments
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
- // unset comments
- unset( $GLOBALS['menu'][25] );
- // unset menuentry Discussion
- unset( $GLOBALS['submenu']['options-general.php'][25] );
+
+ // Remove menu entries with WP 3.1 and higher
+ if ( function_exists( 'remove_menu_page' ) ) {
+ remove_menu_page( 'edit-comments.php' );
+ remove_submenu_page( 'options-general.php', 'options-discussion.php' );
+ } else {
+ // unset comments
+ unset( $GLOBALS['menu'][25] );
+ // unset menuentry Discussion
+ unset( $GLOBALS['submenu']['options-general.php'][25] );
+ }
}
/**

0 comments on commit c737b97

Please sign in to comment.