[wp-trac] [WordPress Trac] #31154: register_post_type function does not check reserved post_types
WordPress Trac
noreply at wordpress.org
Wed Jan 28 11:13:29 UTC 2015
#31154: register_post_type function does not check reserved post_types
-------------------------------+-----------------------------
Reporter: sebastiaandegeus | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
the function register_post_type() in wp-includes/post.php does not check
for reserved post types. But later on this will cause malfunctions or
unexpected behaviour and bugs.
I wrote a very simple patch that checks if any of the reserved post_types
are being registered and if so it notifies the developer by
_doing_it_wrong and WP_Error as a fallback.
Projects and plugins that are using reserved post_types in the wild will
not break. But the developers will be notified via the logs or on their
development environments where WP_DEBUG is true.
ps. I will submit a similar ticket for taxonomies after this one.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31154>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list