Archive

Posts Tagged ‘meta box’

How to add WordPress meta boxes to the sidebar

March 27th, 2009 2 comments

Unfortunately, the WordPress online documentation is a mess of old, outdated API information and when I tried to make a little plugin today and have it put a little meta box in the sidebar of the edit/new post admin pages, I had one hell of a hard time getting things to work the way it was documented.

Everywhere I looked, it told me to hook on to the “admin_menu” event when I wanted to queue up my meta box using add_meta_box().  After a bit of messing around, it seemed as though I had it working for the edit post page, but then it wasn’t showing up on the add new post page.  I did a bit of debugging and ensured that it was the fact that the add_meta_box() call wasn’t being queued properly – I assume it had something to do with when it was being added to the meta box queue… ultimately meaning that the “admin_menu” event was too early of an event for me to hook on to.
Read more…