Custom post types menus being removed
-
hi,
the plugin works great out of the box, there is only one issue. Menus of the custom post types are removed. I found the culprit. It is the wpsite_comment_moderator_remove_menu() method inside of wpsite-comment-moderator.php . I fixed/hacked it with the following alteration:static function wpsite_comment_moderator_remove_menu() { $user = wp_get_current_user(); if (!empty($user) && in_array('comment_moderator', (array) $user->roles)) { remove_menu_page( 'edit.php' ); remove_menu_page( 'tools.php' ); $post_types = get_post_types('', 'names'); foreach ($post_types as $post_type) { // my hack if($post_type == 'my_removed_menu_post_type') {break;} remove_menu_page("edit.php?post_type=$post_type"); } } }
I didn’t really dig deep into why edit.php and tools.php have to be removed and only hacked the solution.
Is there any way you could look into the matter and find out a more elegant solution.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom post types menus being removed’ is closed to new replies.