Media: Check that a router region exists before attempting to access its child views. Add relevant documentation.

Merges [23260] to the 3.5 branch.

props koopersmith.
fixes #22930.



git-svn-id: https://core.svn.wordpress.org/branches/3.5@23268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Limit the execution of wp_enqueue_media() to once per page. Prevents multiple _wpMediaViewsL10n variables.

Merges [23214] to the 3.5 branch.
fixes #22843.



git-svn-id: https://core.svn.wordpress.org/branches/3.5@23269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Media: Automatically select uploading attachments in single-select workflows.

The code now automatically selects uploading attachments in all workflows. In a workflow that selects multiple attachments, all attachments added to the upload queue are selected. In a workflow that selects a single attachment (e.g. selecting a featured image), the last attachment added to the upload queue is selected.

Merges [23259] to the 3.5 branch.

props koopersmith.
fixes #22817.



git-svn-id: https://core.svn.wordpress.org/branches/3.5@23270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure that get_archive_template() only loads a post type archive (archive-$post_type.php file) if there is exactly one post type in the query.

Merges [23249] to the 3.5 branch.

props scribu.
see #22956.



git-svn-id: https://core.svn.wordpress.org/branches/3.5@23271 1a063a9b-81f0-0310-95a4-ce76da25c4cd