<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>www.nerdscene.com &#187; meta box</title>
	<atom:link href="http://www.nerdscene.com/tag/meta-box/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nerdscene.com</link>
	<description>bitching about everything, one post at a time...</description>
	<lastBuildDate>Tue, 06 Apr 2010 17:40:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to add WordPress meta boxes to the sidebar</title>
		<link>http://www.nerdscene.com/2009/03/27/56/</link>
		<comments>http://www.nerdscene.com/2009/03/27/56/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 03:16:48 +0000</pubDate>
		<dc:creator>Eli Sand</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[meta box]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugin]]></category>

		<guid isPermaLink="false">http://www.nerdscene.com/?p=56</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>Everywhere I looked, it told me to hook on to the &#8220;admin_menu&#8221; 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&#8217;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&#8217;t being queued properly &#8211; I assume it had something to do with when it was being added to the meta box queue&#8230; ultimately meaning that the &#8220;admin_menu&#8221; event was too early of an event for me to hook on to.<br />
<span id="more-56"></span><br />
Nowhere in any of the documentation could I find any information stating what event should be hooked &#8211; in fact the documentation relating to add_meta_box() even said to use &#8220;admin_menu&#8221;.  After a few hours of messing around with their documentation and trying various event hooks, I finally found an event hook that appears to work for me &#8211; &#8220;admin_head&#8221;.  Using that event hook seems to be late enough that my meta box gets queued properly and shows up on both pages, but early enough that it&#8217;s not too late to add a meta box to the queue (which was another problem as well).</p>
<p>A friendly note to the WordPress developers &#8211; learn to bloody program; use output buffering (though you probably are already) and make <em>useful</em> event hooks.  If you&#8217;re going to introduce output queues for things like meta boxes &#8211; don&#8217;t make <em>using</em> the queues such a hassle (aka, these queues should <em>not</em> be dependant on HTML output)!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nerdscene.com/2009/03/27/56/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

