Can I exclude CPTs?
-
I have three CPTs, none of which need the calendar. Can I exclude them somehow?
-
What are CPTs?
Custom Post Types.
We show a separate calendar for each custom post type. You don’t need to do anything to exclude them.
I don’t want the calendar at ALL for my custom post types, is the point 🙂 I don’t need it for them.
You know how you omit pages from having a calendar? Like that. Is there a filter or something I can hook into to say “And no calendar for this post type”?
We don’t have a filter to hide that option. You could hide that menu option with CSS.
-
This reply was modified 7 years, 11 months ago by
Zack Grossbart.
Speaking as a forum mod, please don’t sign your posts. It’s actually against the guidelines 🙂
And speaking as a user, it would be nice if there was a filter to hide the calendar for post types where they’re unnecessary. Consider that a feature request please and thank you.
Thank you for the feature request and the forum review.
What would you want that feature to look like? Would it be something you would set with code or something in the UI? Are there other plugins that do something similar? I’d like to follow a common pattern if there is one.
Well, we would just want a settings page, to have the possibility to switch on/off support for various custom post types. With posts as default, it is fine, but I don’t want it for (as an example) the custom post types books or authors. Since there is no real planning for those posts, I would not like to have a calendar there. Not for every other postype than posts, it show the calendar.
Is it clear what this request is about?
Peter Luit
Netherlands-
This reply was modified 7 years, 10 months ago by
Peter Luit.
Thank you Peter. That is clear. I’ll need to think about that. It’s a major change to the way the calendar works now and won’t be something we can do soon.
+1 to this feature request.
Ummm…. actually, it looks like you do have a filter to exclude custom post types. 🙂
Just add this to your functions.php
// Suppress the editorial calendar for a custom post type. add_filter('edcal_show_calendar_{your-post-type}', function() { return false; });You can see the filter is applied in line 124 of edcal.php
-
This reply was modified 7 years, 10 months ago by
James Dilworth.
[removed – after the code above was fixed, it worked]
-
This reply was modified 7 years, 10 months ago by
Ipstenu (Mika Epstein).
Thank you @stjaymz, that worked perfectly for me. I am now filtering out five custom post types that I don’t want the calendar feature for.
I would also very much like a settings page that simply listed all the custom post types with checkboxes next to them so you can easily enable/disable where it shows up. I’ve seen many plugins do this already. 🙂
-
This reply was modified 7 years, 11 months ago by
The topic ‘Can I exclude CPTs?’ is closed to new replies.