WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#12450 closed enhancement (duplicate)

Improve meta_box api

Reported by: prettyboymp Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Administration Keywords:
Focuses: Cc:

Description

I think we should work on improving the API for handling meta_boxes, specifically when it comes to the ones dealing with post_meta.

Specific improvements I'd like to see are:

Automatic handling of checking against the revision, DOING_CRON, DOING_AJAX, and DOING_AUTOSAVE before firing the save method.

A registration method similar to registering post_types so that plugins that add post_types can see registered meta_handlers like registered post_types can be seen.

Built in handling for the post_type_supports() methods based on arguments when registering the meta_handler.

Change History (5)

comment:1 prettyboymp4 years ago

  • Cc mpretty@… added

comment:2 mikeschinkel4 years ago

  • Cc mikeschinkel@… added

+1

I needed all that this past weekend. :)

comment:3 scribu4 years ago

  • Cc scribu@… added
  • Component changed from General to Administration

comment:4 scribu4 years ago

Meta boxes could have a class similar to WP_Widget.

One of the most useful features of this class could be to allow boxes to be configurable (think dashboard RSS box).

Automatic handling of checking against the revision, DOING_CRON, DOING_AJAX, and DOING_AUTOSAVE before firing the save method.

Note that post boxes are just a subset. So the correct class hierarchy would be:

WP_Box > WP_Box_Post > WP_Box_Post_Publish

comment:5 nacin3 years ago

  • Milestone Awaiting Triage deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Let's go with #15066 as a duplicate.

Note: See TracTickets for help on using tickets.