Make sure we're on the media grid page before calling wp.media().

Merges [29725] to the 4.0 branch.

props azaozz.
fixes #29520.

Built from https://develop.svn.wordpress.org/branches/4.0@30254


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Create new $wp_roles object in install_blog() to avoid protected _init() call

Merges [30242] to the 4.0 branch.

Our call to `$wp_roles->_init()` relied on the `__call()` method in `WP_Roles` to handle the link to the protected method. This works back to PHP 5.2.9, when a bug was fixed allowing access to protected methods through this exact approach.

`install_blog()` needs a fresh `$wp_roles` object after `populate_roles()` resets everything in its path. We can create this new object from scratch, effectively doing the same thing with the call to `_init()` via the constructor.

props jeremyfelt.
fixes #29692.

Built from https://develop.svn.wordpress.org/branches/4.0@30255


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Editor expand: hide TinyMCE float panels and tooltips when scrolling.

Merges [29738] to the 4.0 branch.

props avryl.
see #29516.

Built from https://develop.svn.wordpress.org/branches/4.0@30256


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
TinyMCE wpView: when pasting/inserting content before a view, add new paragraph above it and insert the content there.

Merges [29766] to the 4.0 branch.

props avryl.
fixes #29380.

Built from https://develop.svn.wordpress.org/branches/4.0@30257


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Make sure the $parent argument of wp_insert_attachment() still works as expected after [28579].

Merges [29745] to the 4.0 branch.

props jesin, dikiy_forester.
fixes #29646.

Built from https://develop.svn.wordpress.org/branches/4.0@30258


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Avoid PHP notices in media modal caused by orphaned attachments.

Merges [29724] to the 4.0 branch.

props SergeyBiryukov.
fixes #29566.

Built from https://develop.svn.wordpress.org/branches/4.0@30259


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Create correct permalinks for child posts of hierarchical post types when default permalinks are used.

Merges [29765] to the 4.0 branch.

props loushou.
fixes #29615.

Built from https://develop.svn.wordpress.org/branches/4.0@30260


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In `wp_audio|video_shortcode()`, make sure that `autoplay` and `loop` are booleans. Passing `'false'` to them will force them to be active, which is bad. 

Merges [30185] to the 4.0 branch.

props wonderboymusic.
fixes #29825.

Built from https://develop.svn.wordpress.org/branches/4.0@30261


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Media Frames: Set the box-sizing CSS property to border-box for checkboxes and radio buttons.

Merges [29727] to the 4.0 branch.

props mlteal.
fixes #29493.

Built from https://develop.svn.wordpress.org/branches/4.0@30262


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30262 1a063a9b-81f0-0310-95a4-ce76da25c4cd