Ticket #5798 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

add_meta_box() API

Reported by: ryan Assigned to: anonymous
Priority: normal Milestone: 2.5
Component: General Version:
Severity: normal Keywords:
Cc:

Description

We need a simple API for adding "meta" boxes to the various edit forms that insulates plugin authors from layout changes such as the transition from dbx to postbox.

Proposal:

function add_meta_box($id, $title, $callback, $context)

$id is an id for the div tag containing the box; $title is the title of the box; $callback is the function to call which will fill the box with content; $context is the context in which the box should be output. Context is edit_post, edit_page, edit_link, edit_post_advanced, edit_page_advanced, edit_link_advanced.

Attachments

add_meta_box.diff (1.9 kB) - added by ryan on 02/08/08 09:43:06.

Change History

02/08/08 09:43:06 changed by ryan

  • attachment add_meta_box.diff added.

02/08/08 09:43:48 changed by ryan

Patch implements add_meta_box() and do_meta_boxes() with sample edit_post and edit_post_advanced contexts.

02/08/08 18:51:37 changed by ryan

(In [6758]) add_meta_box(). see #5798

02/08/08 21:06:16 changed by ryan

(In [6762]) Separate meta box context into page and context to accommodate postbox API changes. see #5798

02/13/08 19:02:44 changed by arickmann

Is there a reason for using:

<?php do_meta_boxes('post', 'normal', $post); ?>

instead of

<?php do_meta_boxes('page', 'normal', $post); ?>

in the file edit-page-form.php, when the advanced meta boxes in the same file use 'page'?

02/13/08 19:20:29 changed by ryan

(In [6826]) Do page, not post, meta boxes. Props arickmann. see #5798

02/13/08 19:20:48 changed by ryan

That's a bug. Fixed. Thanks.

02/13/08 19:22:45 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.