Widget Customizer: Improve error handling. First pass.

* Replace Widget_Customizer_Exception with WP_Error
* Call Previewer.cheatin() to show the cheating message if a user can't change widgets
* Call Previewer.login() to show the login form if a user is logged out
* Show a generic error message on failures

see #27419.

git-svn-id: https://develop.svn.wordpress.org/trunk@27652 602fd350-edb4-49c9-b593-d223f7449a82
Widget Customizer: Fix 'WidgetCustomizerPreview' is undefined error in IE8/9.

* Move `WidgetCustomizerPreview` to `wp.customize.WidgetCustomizerPreview`
* Move `WidgetCustomizerPreview_exports` to export_preview_data()
* Use `_wpWidgetCustomizerPreviewSettings` to transfer settings to `wp.customize.WidgetCustomizerPreview`

see #27485.

git-svn-id: https://develop.svn.wordpress.org/trunk@27653 602fd350-edb4-49c9-b593-d223f7449a82
Widget Customizer: Use Underscores `indexOf` for IE8 compatibility.

props adamsilverstein.
see #27485.

git-svn-id: https://develop.svn.wordpress.org/trunk@27654 602fd350-edb4-49c9-b593-d223f7449a82
Merge branch 'master' into trac-27491

Conflicts:
	src/wp-admin/js/customize-widgets.js
Merge branch 'master' into trac-27491
General code cleanup and improving video sizing in the admin:

* Abstract the setting of a primary button and its callback in `wp.media.view.MediaFrame.MediaDetails`
* Account for the existence or non-existence of `$content_width` in the TinyMCE views for video
* Make sure video models always have dimensions, even if they are the defaults
* For browsers that are not Firefox, don't use a timeout when setting the `MediaElementPlayer` instance in TinyMCE views

See #27320.



git-svn-id: https://develop.svn.wordpress.org/trunk@27655 602fd350-edb4-49c9-b593-d223f7449a82
Move the styling of drag/drop on the editor uploading to media-views.css, see #27465

git-svn-id: https://develop.svn.wordpress.org/trunk@27656 602fd350-edb4-49c9-b593-d223f7449a82
Turn on thumbnail support for `attachment:audio` and `attachment:video`. Change conditionals to check for theme OR post type support when determining whether to turn on the Featured Image UI pieces in the admin.

Fixes #27460.



git-svn-id: https://develop.svn.wordpress.org/trunk@27657 602fd350-edb4-49c9-b593-d223f7449a82
When an HTML5 fallback button is pressed in the Audio or Video Details state, filter the library by that specific mime-type when the Add Audio|Video Source is activated.

See #27389.



git-svn-id: https://develop.svn.wordpress.org/trunk@27658 602fd350-edb4-49c9-b593-d223f7449a82
When inserting a video shortcode into the editor, set the `poster` attribute automatically if the video has a featured image attached to it.

See #27460.



git-svn-id: https://develop.svn.wordpress.org/trunk@27659 602fd350-edb4-49c9-b593-d223f7449a82
TinyMCE:
- Fix PressThis styling when the popup is resized.
- Don't force loading of the media JS.
- Add the 'image' plugin as fallback when no media button(s).
- Add back the link icon tooltip/menu item string for translation.
See #24067, see #24409


git-svn-id: https://develop.svn.wordpress.org/trunk@27660 602fd350-edb4-49c9-b593-d223f7449a82
Twenty Fourteen: Fix typo in contextual help.

props vanillalounge.
fixes #27493.

git-svn-id: https://develop.svn.wordpress.org/trunk@27661 602fd350-edb4-49c9-b593-d223f7449a82
Plupload: switch to urlstream upload method when the 'flash' runtime is used in non IE browsers. This ensures cookies are sent but limits the maximum file size that flash can handle.

By default only IE9 and older use flash so this change is mostly for completeness. It would affect only the (extremely rare) cases where a plugin disables the html5 runtime.

git-svn-id: https://develop.svn.wordpress.org/trunk@27662 602fd350-edb4-49c9-b593-d223f7449a82
Introduce a ms_site_not_found filter to replace NOBLOGREDIRECT.

Move some processing down below the point where we bail if there's no site. Add more documentation.

props jeremyfelt.
fixes #21143, see #27003.


git-svn-id: https://develop.svn.wordpress.org/trunk@27663 602fd350-edb4-49c9-b593-d223f7449a82
Multisite load: Cache the main site lookup query.

props jeremyfelt.
see #27003.


git-svn-id: https://develop.svn.wordpress.org/trunk@27664 602fd350-edb4-49c9-b593-d223f7449a82
Use wp_cache_add() instead of wp_cache_set() when we don't want an unconditional set.

props jeremyfelt.
see #27003.


git-svn-id: https://develop.svn.wordpress.org/trunk@27665 602fd350-edb4-49c9-b593-d223f7449a82
Inline documentation for hooks in wp-includes/category-template.php.

Props kpdesign for the cleanup.
Fixes #27432.


git-svn-id: https://develop.svn.wordpress.org/trunk@27666 602fd350-edb4-49c9-b593-d223f7449a82
Inline documentation for hooks in wp-admin/includes/post.php.

Also moves the primary PHPDoc for the `edit_posts_per_page` hook to wp-admin/includes/post.php.

Props kpdesign for some cleanup.
Fixes #27431.


git-svn-id: https://develop.svn.wordpress.org/trunk@27667 602fd350-edb4-49c9-b593-d223f7449a82
Introduce HTML5 caption support.

When a theme supports HTML5 captions via add_theme_support( 'html5', 'caption' ), figure and figcaption will be used instead of div and p.

There's a bonus. But first, some history: Captions were introduced with an inline style set for the container. This remains, as it is there to force captions to wrap. But this inline style included an extra 10 pixels, which have vexxed theme developers for years. While these pixels were designed to ensure padding around floated images, modern themes handle this with grace. The additional pixels thus feel encumbering.

As the new HTML5 gallery support avoids outputting default gallery styles (again, irking theme developers for years; see #26697), the new HTML5 caption support will also ditch these 10 pixels of unwanted hand-holding. 

The 10 pixels are also removed entirely in the visual editor (and more styles may also disappear here; see #26642), giving themes the power necessary to match the frontend styles.

The filter img_caption_shortcode_width added in 3.7 to work around this madness (see #14380) is skipped entirely when the theme supports HTML5 captions.

props obenland, azaozz.
see #26642. also fixes #9066.


git-svn-id: https://develop.svn.wordpress.org/trunk@27668 602fd350-edb4-49c9-b593-d223f7449a82
Inline documentation for hooks in wp-admin/includes/dashboard.php.

Props mauryaratan. Props kpdesign for some minor cleanup.
Fixes #25752.


git-svn-id: https://develop.svn.wordpress.org/trunk@27669 602fd350-edb4-49c9-b593-d223f7449a82