Make WordPress Core

Opened 4 months ago

Last modified 3 months ago

#43516 reviewing enhancement

Allowing default category to be applied to all CPT associated to 'category' taxonomy

Reported by: enrico.sorcinelli Owned by: SergeyBiryukov
Milestone: 5.0 Priority: normal
Severity: normal Version: trunk
Component: Taxonomy Keywords: has-unit-tests has-patch
Focuses: Cc:


This patch allows to apply the default category term also for post types that have the category taxonomy, not only for post.

It's not a too remote case to register new post type and associate it also with the category taxonomy. Currently in this case, the default_category option value is never applied.

I sent two patches. The first one apply the default category term to all post types associated with the category taxonomy.

If for legacy reason we don't want introduce any behaviour compatibility break - for example with third party plugins - I sent the second one that introduce a new default_category_post_types filter allowing to define for which post types (in addition to post) to set the default_category.

Attachments (2)

43516.default-category-all-cpt.patch (3.0 KB) - added by enrico.sorcinelli 4 months ago.
43516.default-category-filter-cpt.patch (3.7 KB) - added by enrico.sorcinelli 4 months ago.

Download all attachments as: .zip

Change History (5)

#1 @enrico.sorcinelli
4 months ago

  • Keywords has-unit-tests has-patch added

#2 @SergeyBiryukov
3 months ago

  • Milestone changed from Awaiting Review to 5.0
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.