[wp-trac] [WordPress Trac] #27335: wp_insert_post() inserts posts of unregistered post types
WordPress Trac
noreply at wordpress.org
Sun Mar 9 22:23:57 UTC 2014
#27335: wp_insert_post() inserts posts of unregistered post types
-------------------------------+-----------------------------
Reporter: brocheafoin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 3.8.1
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
if you run something like this:
{{{
wp_insert_post(array(
'post_title' => 'My Example',
[...]
'post_type' => 'bogus_post_type_that_is_not_registered'
));
}}}
Your post is inserted into the database and wp_insert_post() returns a
post ID. I would have expected this to be an error.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27335>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list