Hi Devin.
Well, at first I was a bit confused by this and thought there was some complex thing about it with the non-public and taxonomies and if it was a core level thing. Then, I decided to check the CPTUI code.
As it turns out, the part that is querying for those post types to show under the Taxonomy settings, is only querying for public ones. This is a great chance to utilize filters, which I’ve been adding a lot of for one of the next major releases, however it’s not ready for pushing out yet.
So I’m in an odd place where I want to help you, but I’m not sure quite how to go about it yet. I can point you to the spot that sets this argument and let you default the $args variable to an empty array. The problem is that any time the plugin gets updated, you’d have to go re-do that spot, and I’d really not want to put you through that trouble for all your future post types. NOTE: The setting would be saved in the option and you wouldn’t lose previously assigned ones, unless you change that associated post types after the public = true ends up returning in some minor release. I hope that paragraph makes sense.
Now, the other idea I had was letting you know what filter name I’d use, and help you add the apply_filters() function to your own copy. Then you could go to your theme and do an add_filter() on that and set it there, preventing future breaking once the next version comes out that has the filter natively. I’d make sure I use the exact same one I give you here.
So, I’m just about to commit some changes I made to this spot to GitHub. I added this in place of the original $args assignment for get_post_types. I hope you’re familiar with filters and hooks ??
$args = apply_filters( 'cptui_attach_post_types_to_taxonomy', array( 'public' => true ), $cpt_tax_name );
You’ll need to replace the $args variable assignment with the snippet above. It’s on line 1490 of the custom-post-type-ui.php file, for the latest version in the .org repo.
It’ll still default to the public only if no one does anything with it, but this will allow you do the following:
add_filter( 'cptui_attach_post_types_to_taxonomy', 'devin_nonpublic_posttypes' );
function devin_nonpublic_posttypes( $args ) {
return array();
}
That will return just an empty array back to the filter and it’d proceed to query for all, not just the public ones.
If you need help with any of this, do not hesitate to ask, I’m more than willing to help some more. Hopefully the filter solution is good enough for you, and since it’s getting committed already, it won’t end up changing, and I’m hoping I don’t need any more bug releases.