Opened 14 years ago
Closed 12 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: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | |
| Severity: | minor | Keywords: | has-patch close |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.