WordPress.org

Make WordPress Core

Opened 23 months ago

Closed 2 months 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)

20900.diff (625 bytes) - added by georgestephanis 23 months ago.

Download all attachments as: .zip

Change History (4)

georgestephanis23 months ago

comment:1 ircbot2 months ago

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

comment:2 ocean902 months 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.

comment:3 nacin2 months 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.