[wp-hackers] Adding collapsible "meta boxes" to a plugin's option page

James Davis james at freecharity.org.uk
Thu Jun 12 13:36:40 GMT 2008


Aaron D. Campbell wrote:
> Actually, I think that method only works to add them to "comment" "link"
> "page" and "post" unless you combine it with do_meta_boxes.  The $page
> parameter of add_meta_box (4th parameter) can be whatever you want, and
> then you use that same name as the $page parameter (1st parameter) of
> do_meta_boxes to actually create the boxes.

In the function that handles my options page I've added

add_meta_box('fcbox','My box!','something_in_the_box','petition');
do_meta_boxes('petition','default',null);

and later I have

function something_in_the_box() {
    echo "Living in a box world!";
}

defined. But I don't see that box, or text anywhere on my page. Am I
calling do_meta_boxes wrongly (what should that third argument be?)?

James

-- 
http://www.freecharity.org.uk/ - Free IT services for charities
http://www.freecharity.org.uk/wiki/ - The VCSWiki


More information about the wp-hackers mailing list