WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#14133 closed defect (bug) (fixed)

Custom post type breaks the_editor in plugins

Reported by: xiosen Owned by:
Milestone: 3.1 Priority: normal
Severity: major Version: 3.0
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

I previously used the_editor to tap into the wordpress editor in my plugins. With the addition of custom post types in wordpress 3.0, this feature breaks the insert into post within the add media buttons which in turn breaks my plugins ability to use the_editor.

In wp-admin/includes/media.php line 1166 the default 'send' argument now checks for custom post type support whereas in previous versions of wordpress it defaulted to true.

In this instance, using media buttons through the_editor in a plugin does not work since a custom post type was not registered. Since 'send' is now defaulted to false the insert into post buttons do not show up.

I would propose adding a filter for the defaults or setting the 'send' default to true and only checking for post_type_supports if a post parent is found.

Attachments (1)

14133.diff (759 bytes) - added by blepoxp 4 years ago.
If post parent is empty, return true

Download all attachments as: .zip

Change History (6)

comment:1 kevinB4 years ago

  • Cc kevinB added

comment:2 ryan4 years ago

Defaulting to true if post_parent is empty sounds good.

comment:3 nacin4 years ago

  • Keywords needs-patch added; the_editor removed
  • Milestone changed from Awaiting Review to 3.1

blepoxp4 years ago

If post parent is empty, return true

comment:4 blepoxp4 years ago

  • Keywords has-patch added; needs-patch removed

comment:5 ryan4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15920]) Default send to editor to true if the post parent is empty. Props blepoxp. fixes #14133

Note: See TracTickets for help on using tickets.