WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#13630 closed defect (bug) (worksforme)

thickbox not loading when custom post type is registered w/out editor and thumbnail.

Reported by: lag47 Owned by:
Milestone: Priority: low
Severity: minor Version: 3.0
Component: Post Thumbnails Keywords: thickbox, custom post types
Focuses: Cc:

Description

thickbox not loading when custom post type is registered w/out editor and thumbnail. You would think there'd be no need for the thickbox script, however the thumbnail metabox can be added later using 'add_meta_box()'.

example:

register_post_type('my_post_type', array ('supports' => array('title')) ;

add_meta_box("my_thumbnail_div", 'My Featured Image', 'post_thumbnail_meta_box', "my_post_type");

Change History (4)

comment:1 nacin4 years ago

Well... don't do that. Add support for thumbnails instead via register_post_type.

comment:2 nacin3 years ago

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

comment:3 nacin3 years ago

The supports argument for register_post_type() simply wraps register_post_type_support().

If the use case calls for this being a just-in-time thing, you can always use register_post_type_support(), instead of add_meta_box(). That should get you exactly what you want.

comment:4 westi3 years ago

In other words - you should only use add_meta_box to add your own metaboxes not to add ones in core that might have other dependencies and get auto-added when you register support for them.

Note: See TracTickets for help on using tickets.