﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
15000	add_meta_box() should accept array of post types	coffee2code		"I often find myself defining an identical meta box for different post types.  It would be nice if `add_meta_box()` accepted an array as its `$page` argument.  For backward-compatibility the function will still accept a string.  So for all else being equal, the same metabox could be added to multiple post types in a single line of code.  Of course, if the meta box needs per-post_type configuration, `add_meta_box()` could be called separately for each post type.

Example:

{{{
add_meta_box( 'my-geo', 'Geolocation Info', array( &$this, 'geo_form' ), 'post', 'side' );
add_meta_box( 'my-geo', 'Geolocation Info', array( &$this, 'geo_form' ), 'page', 'side' );
add_meta_box( 'my-geo', 'Geolocation Info', array( &$this, 'geo_form' ), 'event', 'side' );
}}}

would become:

{{{
add_meta_box( 'my-geo', 'Geolocation Info', array( &$this, 'geo_form' ), array( 'post', 'page', 'event' ), 'side' );
}}}

Of course, the former would continue to work.

One could certainly loop through the post types manually to call `add_meta_box()`, but I think the proposed patch clarifies coding intention.

Patch is attached.  (In the patch, I didn't indent the content of the newly introduced `foreach() ... endforeach;` since it would look like the whole function got changed when in fact I only made a very minor change.  The function also has a precendent of a non-indented foreach.  However, I would anticipate the actual commit might want the indentation, which can be provided.)

(Note: affects, or affected by, #13937)
"	enhancement	closed	normal		Administration	3.0.1	minor	duplicate	has-patch	
