mmuro/Restrict-Categories — pull request #6 by 2ndkauboy (2014-11-05 18:18:27+00:00)
Title: fixing exclusion on 'new CPT' page

Your plugin already work with custom post types, but only if you edit one. As you check for `$_GET['post_type']` before adding the filter to your `posts()` function the exclusion will not happen on a `post-new.php` page for the CPT, as it has this request param. Although editing a CPT entry does not have the `$_GET['post_type']` param set and therefore you are excluding the categories correctly.

With this little patch, the plugin will not check if a post_type param is set (I even don't know why you do that), but rather checks if the user is on a page to edit/create a post, page or CPT.

As you don't have you latest development branch from SVN on Github (trunk), I filed this pull request against your latest version. But you should be able to apply the patch/diff on your current SVN develpoment branch. If you need help with that, just let me know.