• Resolved Jaka Dirnbek

    (@jakadirnbek)


    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.

    https://wordpress.org/plugins/wpsite-comment-moderator/

Viewing 1 replies (of 1 total)
  • Plugin Author kjbenk

    (@kjbenk)

    Hello jaka,

    Its great to here that you are making use of the plugin. The reason why we remove all editing and tools pages for the Comment Moderator is because they should really only be moderating comments 🙂 This is why when you login as a comment moderator you will only see the Comments menu since you can only edit comments.

    Though, when I had a look at the plugin I saw a little bug and I will be fixing that today with an update 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Custom post types menus being removed’ is closed to new replies.