Opened 12 years ago
Closed 11 years ago
#20900 closed defect (bug) (wontfix)
Throw an error in `get_default_post_to_edit` if the specified post type is not defined.
Reported by: | georgestephanis | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | |
Component: | Posts, Post Types | Keywords: | has-patch close |
Focuses: | Cc: |
Description
Currently get_default_post_to_edit will generate a post with the specified post type, even if it doesn't exist. Let's give it a chance to do something else.
If this is conceptually a good idea, also do it during wp_insert_post() and other similar functions.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
I don't think we need a check on API level.
We have checks on post-new.php and edit.php which prevents user errors. As a developer you should know your post type. Also existing stuff could rely on this, which would break by such a change.