Make WordPress Core

Opened 9 years ago

Closed 8 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:


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)

20900.diff (625 bytes) - added by georgestephanis 9 years ago.

Download all attachments as: .zip

Change History (4)

This ticket was mentioned in IRC in #wordpress-dev by ocean90. View the logs.

8 years ago

#2 @ocean90
8 years ago

  • Keywords close added; 2nd-opinion removed

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.

#3 @nacin
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Yeah, agreed.

Note: See TracTickets for help on using tickets.