[wp-trac] [WordPress Trac] #40484: Create Custom Post Types directly in WP-Admin and Customizer

WordPress Trac noreply at wordpress.org
Wed Apr 19 19:24:29 UTC 2017


#40484: Create Custom Post Types directly in WP-Admin and Customizer
-------------------------------+---------------------------------
 Reporter:  lukecavanagh       |       Owner:
     Type:  feature request    |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  4.7.3
 Severity:  normal             |  Resolution:  wontfix
 Keywords:                     |     Focuses:  ui, administration
-------------------------------+---------------------------------

Comment (by joyously):

 I agree with Luke that CPTs should be handled in core, but not in
 Customizer.
 But my thought is that core should do it differently than it is done
 today. Today, every page load runs through the registration of the core
 post types and filters and actions. One the way, plugins can register
 their post types and actions and filters. So the post types are "known"
 for that page load, and it could be different for the next page load. That
 means that if the plugin is deactivated, that post type is not known
 (registered), so there could be CPTs in the posts table that don't have a
 known way to interact with everything else. But what if instead of
 registering on every page load, the registration is done once, and stored
 in the options table? Then the registration code doesn't have to run each
 page load. Instead the post types would be loaded from the options, and
 the data in the posts table is known regardless of the plugin running or
 not.  With this sort of change, I could see core as the proper place for
 showing which post types are known and deleting them.

 I think suggesting that CPTs be handled in all respects by core is a bit
 of a stretch to start with. But I think small things such as what the
 plugin "Custom Post Archives" does is entirely to be expected to be part
 of core. (it shows a list of post types and user can choose which to show
 archives and rss for)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40484#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list