Commit Graph

5732 Commits

Author SHA1 Message Date
Gary Pendergast
83c3e3e00e Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.

In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.

For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.

Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia

Fixes #32522.


Built from https://develop.svn.wordpress.org/trunk@34903


git-svn-id: http://core.svn.wordpress.org/trunk@34868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 10:36:25 +00:00
Jeremy Felt
31b29fccbd Tests: Remove static capture of space used and space allowed.
Originally introduced in [34601], this was necessary to avoid test pollution. Now that things have been separated and written to play nicely, we can remove this.

See #34037.

Built from https://develop.svn.wordpress.org/trunk@34902


git-svn-id: http://core.svn.wordpress.org/trunk@34867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 07:25:24 +00:00
Jeremy Felt
297148d985 Tests: Improve tests for upload_is_user_over_quota().
* Move all tests to a new 'multisite/uploadIsUserOverQuota.php'
* Use `get_space_allowed` and `pre_get_space_used` filters to help avoid test pollution.

See #34037.

Built from https://develop.svn.wordpress.org/trunk@34901


git-svn-id: http://core.svn.wordpress.org/trunk@34866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 07:21:24 +00:00
Jeremy Felt
7b3fa2221a Tests: Account for non-numeric strings in tests for get_space_allowed().
Provides a specific test for a case where a non-numeric strings are assigned to `blog_upload_space` at both the site and network levels.

See #34037.

Built from https://develop.svn.wordpress.org/trunk@34900


git-svn-id: http://core.svn.wordpress.org/trunk@34865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 06:17:24 +00:00
Jeremy Felt
7f2f3d614e Tests: Improve tests for is_upload_space_available().
* Move all tests to a new 'multisite/isUploadSpaceAvailable.php'
* Store original `blog_upload_space` values before the class is loaded.
* Restore these values after each test tear down to avoid pollution.

Commit to testing `is_upload_space_available()` itself by always filtering the amount of space used through `pre_get_space_used`. This allows us to sanely test without worrying about the local environment. In the future, we may be able to remove some of these tests as `get_upload_space_available()` tests are built out and reliable.

See #34037.

Built from https://develop.svn.wordpress.org/trunk@34899


git-svn-id: http://core.svn.wordpress.org/trunk@34864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 06:15:25 +00:00
Jeremy Felt
daea4ff02f Tests: Improve tests for get_space_allowed().
* Move all tests to a new `multisite/getSpaceAllowed.php`
* Store original `blog_upload_space` values before the class is loaded.
* Restore these values after each test tear down to avoid pollution.
* Add a comprehensive set of expectations and results via data provider.

See #34037.

Built from https://develop.svn.wordpress.org/trunk@34898


git-svn-id: http://core.svn.wordpress.org/trunk@34863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 04:58:24 +00:00
Scott Taylor
a1ead3c7e3 List Tables: in _WP_List_Table_Compat::get_column_info(), also return $primary, which is expected since [33016].
Props tyxla.
Fixes #34148.

Built from https://develop.svn.wordpress.org/trunk@34897


git-svn-id: http://core.svn.wordpress.org/trunk@34862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 03:12:24 +00:00
Boone Gorges
226bb29ff0 Move wp_installing() to load.php.
Various functions in load.php need to check whether WP is in installation mode.
Let's let them.

Props adamsilverstein.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34896


git-svn-id: http://core.svn.wordpress.org/trunk@34861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 03:02:23 +00:00
Scott Taylor
ae813883f5 Meta Boxes: add an action, post_submitbox_minor_actions. post_submitbox_misc_actions already exists. Pass $post to both for context - avoids having to check for a global post.
Props jonathanbardo, chriscct7, DrewAPicture.
Fixes #26267.

Built from https://develop.svn.wordpress.org/trunk@34895


git-svn-id: http://core.svn.wordpress.org/trunk@34860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 02:45:25 +00:00
Scott Taylor
4d3223b28e Introduce wp_get_server_protocol() to DRY protocol parsing logic and make adding more protocols, like HTTP/2, easier.
Props johnbillion, wonderboymusic.
Fixes #34131.

Built from https://develop.svn.wordpress.org/trunk@34894


git-svn-id: http://core.svn.wordpress.org/trunk@34859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 02:35:26 +00:00
Scott Taylor
2783773775 Meta Boxes: reboot some of the code in postbox.js to support aria-expanded attribute toggling and to properly reference static class properties.
Props afercia, wonderboymusic.
Fixes #33754.

Built from https://develop.svn.wordpress.org/trunk@34893


git-svn-id: http://core.svn.wordpress.org/trunk@34858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 01:58:25 +00:00
Scott Taylor
a3ec4d45f3 List Tables: after [34276], decrease horizontal padding for sorted column headers (causing weirdness in the Count column of tax list tables) - the vertical padding change suffices in fixing the original issue.
Fixes #27945.

Built from https://develop.svn.wordpress.org/trunk@34892


git-svn-id: http://core.svn.wordpress.org/trunk@34857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 01:40:24 +00:00
Scott Taylor
0c2b2a0e3d List Tables/WP_Screen: in WP_Screen, add methods to store, retrieve, and render screen reader text, primarily used by list table screens.
These additions are based on an audit and recommendations by the Accessibility team. #a11y'all

Props afercia.
Fixes #32147.

Built from https://develop.svn.wordpress.org/trunk@34891


git-svn-id: http://core.svn.wordpress.org/trunk@34856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 01:28:25 +00:00
Scott Taylor
b3a07ab8ea Rewrite/Permalinks/Canonical: in url_to_postid(), call set_url_scheme() on the URL to combat mixed content issues and find posts cross-scheme.
Adds unit tests.

Props swissspidy.
Fixes #34144.

Built from https://develop.svn.wordpress.org/trunk@34890


git-svn-id: http://core.svn.wordpress.org/trunk@34855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 01:07:24 +00:00
Scott Taylor
7547dc5125 Posts List Table: ensure that "All" gets the "current" CSS class when applicable.
Props afercia.
Fixes #19609.

Built from https://develop.svn.wordpress.org/trunk@34889


git-svn-id: http://core.svn.wordpress.org/trunk@34854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 00:09:24 +00:00
Scott Taylor
27fd5b762b Build Tools: upgrade grunt-browserify to ~4.0.0 and remove the watch task for browserify, which has its own internal watcher. Run npm install to update.
Props iseulde.
Fixes #31911.

Built from https://develop.svn.wordpress.org/trunk@34888


git-svn-id: http://core.svn.wordpress.org/trunk@34853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 00:00:43 +00:00
Sergey Biryukov
987ec5e6ad Remove closing PHP tag from wp-includes/class-phpass.php.
Previously: [19712], [28678].

Props iamfriendly, amandato.
Fixes #30534.
Built from https://develop.svn.wordpress.org/trunk@34887


git-svn-id: http://core.svn.wordpress.org/trunk@34852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 23:45:25 +00:00
Drew Jaynes
51a5e818da Docs: Only document get_posts() argument defaults that differ from, or aren't present in the defaults offered by WP_Query::parse_query().
Props johnbillion.
Fixes #34156.

Built from https://develop.svn.wordpress.org/trunk@34886


git-svn-id: http://core.svn.wordpress.org/trunk@34851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 23:19:24 +00:00
Drew Jaynes
fa4fed0f80 Login: Pass the $errors object as a parameter to the lostpassword_post hook.
Props iamfriendly.
Fixes #32116.

Built from https://develop.svn.wordpress.org/trunk@34885


git-svn-id: http://core.svn.wordpress.org/trunk@34850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 23:00:25 +00:00
Drew Jaynes
6079c4c6d2 Docs: _pad_term_counts() takes an array of objects passed by reference, not term IDs.
Props wpsmith.
Fixes #34174.

Built from https://develop.svn.wordpress.org/trunk@34884


git-svn-id: http://core.svn.wordpress.org/trunk@34849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 22:39:23 +00:00
Weston Ruter
aa044b054e Customizer: Ensure that wp.customize.Widgets.savedWidgetIds is defined up front.
In 4.3 the widget controls were fully initialized up front along with the sidebar controls. The sidebar control depended (unnecessarily) on the widget control to ensure that `wp.customize.Widgets.savedWidgetIds` was defined. So after [34563] there could be a situation where the widgets are added/removed from a sidebar before their controls are initialized (if the sidebar section is never expanded), resulting in an error attempting to get a property off of an undefined value. So this change does the right thing and defines `savedWidgetIds` up front.

Also changes the `savedWidgetIds` variable type from an array to an object, to match how it is used as a dictionary lookup.

See #33901.

Built from https://develop.svn.wordpress.org/trunk@34883


git-svn-id: http://core.svn.wordpress.org/trunk@34848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 21:59:25 +00:00
Jeremy Felt
8286a4f214 Registration: Remove the last remaining Lucida Grande from WordPress.
Defer to default styling provided by the theme (and browser) in `wp-activate.php` and remove the `font-family` and `color` from the provided internal stylesheet.

Previously, [17327] and [18406].

Fixes #34145.

Built from https://develop.svn.wordpress.org/trunk@34882


git-svn-id: http://core.svn.wordpress.org/trunk@34847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 21:56:24 +00:00
Konstantin Obenland
442c393599 Posts: Add post class for password protected posts.
Up until now password protected posts would only get a identifying class when
the password was still required. This adds a class for the case when that
requirement has been met.

For the other visibility types we already have `status-publish`
and `status-private`.

Props mdgl, F4rkie, wonderboymusic for initial patches.
Fixes #21899.


Built from https://develop.svn.wordpress.org/trunk@34881


git-svn-id: http://core.svn.wordpress.org/trunk@34846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 21:54:24 +00:00
Aaron Jorbin
a93ec5244d Revert [34875] due to unintentional breaking change
WordPress.org was taken down due to as Otto42 describes:

The previous version of this function added the query piece for the meta key = blog_id.capabilities, regardless of whether or not a role was requested. This limits the users returned to those with some defined role on this particular multisite instance.

See #22212



Built from https://develop.svn.wordpress.org/trunk@34880


git-svn-id: http://core.svn.wordpress.org/trunk@34845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 20:58:24 +00:00
Aaron Jorbin
2ac3027a58 Add message with status info to temperamental assertion.
The ajax delete comment tests are intermittently failing. Many of the assertions make it hard to tell why they are failing. This adds a message to one of those assertions that contains some info on what is being asserted with the goal that it helps developers understand why the failure is failing.

See #33968


Built from https://develop.svn.wordpress.org/trunk@34879


git-svn-id: http://core.svn.wordpress.org/trunk@34844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 19:56:24 +00:00
Sergey Biryukov
2702fd12cf Transients: Clarify the expiration_of_site_transient_$transient filter description.
See #21330.
Built from https://develop.svn.wordpress.org/trunk@34878


git-svn-id: http://core.svn.wordpress.org/trunk@34843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 18:11:24 +00:00
Dominik Schilling
e237e59172 Transients: Rename filters added in [34865].
* `expiration_pre_set_transient_$transient` => `expiration_of_transient_$transient`
* `expiration_pre_set_site_transient_$transient` => `expiration_of_site_transient_$transient`

Fix hook docs.

Props chriscct7.
Fixes #21330.
Built from https://develop.svn.wordpress.org/trunk@34877


git-svn-id: http://core.svn.wordpress.org/trunk@34842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:59:25 +00:00
Drew Jaynes
1e2caf6712 Docs: Update an inline comment in wp_get_attachment_image_sizes(), which came in as part of the Responsive Images merge in [34855].
Props joemcgill.
See #33641.

Built from https://develop.svn.wordpress.org/trunk@34876


git-svn-id: http://core.svn.wordpress.org/trunk@34841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:47:24 +00:00
Boone Gorges
f233b37d07 Improve role-related arguments in WP_User_Query.
* 'role' now accepts an array or comma-separated list of role names. When passing multiple values for 'role', `WP_User_Query` will only match users that have all of the specified roles.
* 'role__in' accepts an array of role names, and allow the filtering of matched users to those with at least one of the specified roles.
* 'role__not_in' accepts an array of role names, and allows the filtering of matched users to those who have none of the specified roles.

Props swissspidy, mordauk, barrykooij, sirbrillig.
Fixes #22212.
Built from https://develop.svn.wordpress.org/trunk@34875


git-svn-id: http://core.svn.wordpress.org/trunk@34840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:40:47 +00:00
Aaron Jorbin
0978abe76c Adjust detection of stream timeouts in maybe skip tests for https tests
This is a follow up to [34848].

See #33968.


Built from https://develop.svn.wordpress.org/trunk@34874


git-svn-id: http://core.svn.wordpress.org/trunk@34839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:40:24 +00:00
Dominik Schilling
0bc1d84fc7 MS Themes List Table: Fix inverted logic for displaying the "No items" message.
Fixes #25464.
Built from https://develop.svn.wordpress.org/trunk@34873


git-svn-id: http://core.svn.wordpress.org/trunk@34838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:35:23 +00:00
Sergey Biryukov
551b904985 Fix typo in [34848].
See #33968.
Built from https://develop.svn.wordpress.org/trunk@34872


git-svn-id: http://core.svn.wordpress.org/trunk@34837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:28:24 +00:00
Drew Jaynes
5df204fab4 Template: Introduce a new class_form argument in comment_form(), allowing customization of the form class attribute.
The static 'comment-form' class was originally added to `comment_form()` in [24525]. This new argument should provide needed flexibility in styling the comment form further.

Props flixos90.
Fixes #34170. See #23851.

Built from https://develop.svn.wordpress.org/trunk@34871


git-svn-id: http://core.svn.wordpress.org/trunk@34836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:17:24 +00:00
Drew Jaynes
f7bf281978 Tests: Update Tests_Rewrite_AddRewriteRule->setUp() to use the new set_permalink_structure() helper.
See #33968.

Built from https://develop.svn.wordpress.org/trunk@34870


git-svn-id: http://core.svn.wordpress.org/trunk@34835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 16:02:25 +00:00
Dominik Schilling
273cae2573 Script Loader: Update version of json2.js after [34863].
See #26913.
Built from https://develop.svn.wordpress.org/trunk@34869


git-svn-id: http://core.svn.wordpress.org/trunk@34834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 15:52:26 +00:00
Helen Hou-Sandí
cd3367d942 Shortcodes: Pass the name as context for shortcode_atts_{$shortcode}.
props mattheu.
fixes #34167.

Built from https://develop.svn.wordpress.org/trunk@34868


git-svn-id: http://core.svn.wordpress.org/trunk@34833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 14:34:24 +00:00
Scott Taylor
2d1fff2c75 Setup/Config: some dirname( ABSPATH ) file lookups should have errors suppressed due to possibility of open_basedir restrictions on hosts.
Props chriscct7, misterunknown.
Fixes #29680.

Built from https://develop.svn.wordpress.org/trunk@34867


git-svn-id: http://core.svn.wordpress.org/trunk@34832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 14:20:25 +00:00
Scott Taylor
ddbd67a22e Media: in wp_read_video|audio_metadata(), set GETID3_TEMP_DIR to get_temp_dir() if it is not defined. This is a workaround for when safe_mode is enabled pre-PHP 5.3.
Props chriscct7, tomsommer.
Fixes #26265.

Built from https://develop.svn.wordpress.org/trunk@34866


git-svn-id: http://core.svn.wordpress.org/trunk@34831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 14:14:25 +00:00
Scott Taylor
1dcc6e1b51 Transients, add filters for $expiration:
* `'expiration_pre_set_site_transient_' . $transient`
* `'expiration_pre_set_transient_' . $transient`
 
Props chriscct7, wpsmith, nacin.
Fixes #21330.

Built from https://develop.svn.wordpress.org/trunk@34865


git-svn-id: http://core.svn.wordpress.org/trunk@34830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 14:10:25 +00:00
Scott Taylor
53060a8987 WP Mail: replace logic that was mimicking strtotime() with strtotime(). Without this, the date parsing wasn't accounting for half-hour and quarter-hour timezones.
Props neoscrib, solarissmoke.
Fixes #16993.

Built from https://develop.svn.wordpress.org/trunk@34864


git-svn-id: http://core.svn.wordpress.org/trunk@34829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 14:07:24 +00:00
Scott Taylor
c32357a900 External Libraries: update json2.js to the 2015-05-03 version. Crockford does not tag releases: https://github.com/douglascrockford/JSON-js/commits/master
Props mgibbs189, chriscct7.
Fixes #26913.

Built from https://develop.svn.wordpress.org/trunk@34863


git-svn-id: http://core.svn.wordpress.org/trunk@34828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 14:02:25 +00:00
Scott Taylor
a3e36194fd Scripts: in WP_Scripts::set_group(), the args prop of the _WP_Dependency instance defaults to null - check that it is set before comparing.
Props tivnet, chriscct7.
Fixes #25462.

Built from https://develop.svn.wordpress.org/trunk@34862


git-svn-id: http://core.svn.wordpress.org/trunk@34827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 13:54:25 +00:00
Scott Taylor
c5475fbfc2 Admin Menu: remove duplicated separators, and use strpos() (instead of strcmp()) when determining if the separator CSS class is present.
Props rilwis, chriscct7.
Fixes #24104.

Built from https://develop.svn.wordpress.org/trunk@34861


git-svn-id: http://core.svn.wordpress.org/trunk@34826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 13:46:25 +00:00
Scott Taylor
8c256a3357 XML-RPC: allow wp_xmlrpc_server::wp_getPosts() to receive s as a filter.
Props chriscct7.
Fixes #25406.

Built from https://develop.svn.wordpress.org/trunk@34860


git-svn-id: http://core.svn.wordpress.org/trunk@34825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 13:41:26 +00:00
Drew Jaynes
eeb76b6e56 Users: Don't typo assertTrue() in a the uppercase letters validate_username() test.
See #24618.

Built from https://develop.svn.wordpress.org/trunk@34859


git-svn-id: http://core.svn.wordpress.org/trunk@34824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 07:10:25 +00:00
Drew Jaynes
33150c45d9 Users: Add a separate test for checking the validity of a username containing uppercase characters in the scope of single vs multisite.
'JohnDoe' in single site: valid
'JohnDoe' in multisite: invalid

See #24618.

Built from https://develop.svn.wordpress.org/trunk@34858


git-svn-id: http://core.svn.wordpress.org/trunk@34823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 07:02:24 +00:00
Gary Pendergast
74aef3b75d Tests: Dequeue the styles and scripts enqueued by Test_WP_Customize_Nav_Menus::test_enqueue_scripts().
Fixes #34163.


Built from https://develop.svn.wordpress.org/trunk@34857


git-svn-id: http://core.svn.wordpress.org/trunk@34822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 05:48:24 +00:00
Drew Jaynes
7b82d75ec8 Users: Empty sanitized usernames should be considered invalid when passed through validate_username().
Adds tests.

Props gwinhlopez for the initial patch.
Props mordauk, chriscct7.
Fixes #24618.

Built from https://develop.svn.wordpress.org/trunk@34856


git-svn-id: http://core.svn.wordpress.org/trunk@34821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 05:35:25 +00:00
Scott Taylor
99be7beda0 Merge the Responsive Images feature plugin into core, initial commit. See: https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images/
New functions in `media.php`:
* `wp_get_attachment_image_srcset_array()` - Returns an array of image candidate string data used to build a `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_srcset()` - Returns the `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_sizes()` - Returns the `sizes` value for an attachment given an `$attachement_id` and `$size` and optional arguments used to alter its output.
* `wp_make_content_images_responsive()` - A display filter for adding `srcset` and `sizes` to images embedded in content.
* `wp_img_add_srcset_and_sizes()` - A utility function used by `wp_make_content_images_responsive()` to add `srcset` and `sizes` to a single `<img>` element.

Modifies existing core functions:
* Modify `wp_get_attachment_image()` so the HTML returned for an image includes `srcset` and `sizes`.
* Modify `get_media_embedded_in_content()` (sup, 3.6 leftover) by adding `<img>` to the list of accepted tags that can be matched in content. This is used in `wp_make_content_images_responsive()` to find all of the images embedded in content before passing them off to `wp_img_add_srcset_and_sizes()`.

Tests:
* Add a new factory method to `WP_UnitTest_Factory_For_Attachment` named `create_upload_object()`
* Adds unit tests
* Updates unit tests

Props joemcgill, tevko, jaspermdegroot, mdmcginn, barryceelen, peterwilsoncc, fsylum, wonderboymusic, chriscoyier, benjaminpick, jrfnl, #12kingkool68, janhenckens, ryanmarkel, side777, ryelle, wturrell, micahmills, mattbagwell, coliff, DrewAPicture.
See #33641.

Built from https://develop.svn.wordpress.org/trunk@34855


git-svn-id: http://core.svn.wordpress.org/trunk@34820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:59:24 +00:00
Drew Jaynes
65133a89c1 Multisite: Introduce get_subdirectory_reserved_names(), which returns a filterable list of reserved subdirectory site names.
The function encapsulates the existing `subdirectory_reserved_names` filter and reduces the maintenance burden of keeping the value of (currently) two instances of the same hook in sync.

See #33615.

Built from https://develop.svn.wordpress.org/trunk@34854


git-svn-id: http://core.svn.wordpress.org/trunk@34819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:35:25 +00:00
Scott Taylor
2003bc15ba Multisite: in wpmu_validate_blog_signup(), pass embed to the array passed to subdirectory_reserved_names.
See #32522.

Built from https://develop.svn.wordpress.org/trunk@34853


git-svn-id: http://core.svn.wordpress.org/trunk@34818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:05:24 +00:00
Gary Pendergast
7938e3c1bf Tests: Make the Attachment Slashes tests clean up after itself.
Fixes #34162.


Built from https://develop.svn.wordpress.org/trunk@34852


git-svn-id: http://core.svn.wordpress.org/trunk@34817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:01:24 +00:00
Scott Taylor
d96fb9def9 Embeds: move some functions from media.php to a new file, embed-functions.php, via svn cp
See #32522.

Built from https://develop.svn.wordpress.org/trunk@34851


git-svn-id: http://core.svn.wordpress.org/trunk@34816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:59:24 +00:00
Scott Taylor
3ef27f7929 oEmbed: add embed to $subdirectory_reserved_names.
Props jeremyfelt.
See #32522.

Built from https://develop.svn.wordpress.org/trunk@34850


git-svn-id: http://core.svn.wordpress.org/trunk@34815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:45:25 +00:00
Aaron Jorbin
fb624b32ac Fix whitespace issues introduced in [34848]
Bad Jorbin.

See #33968

Built from https://develop.svn.wordpress.org/trunk@34849


git-svn-id: http://core.svn.wordpress.org/trunk@34814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:41:24 +00:00
Aaron Jorbin
55f4da677f HTTP timeouts should cause some tests to be skipped, not failed
A number of the HTTP external tests can inconstantly fail. As the HTTP API is one that doesn't change often, this failure creates noise. With the goal of increasing the signal from the unit tests, these tests are now skipped if they timeout. A notice is added when running the external http tests so that the developer knows what skipped tests may mean here.

See #33968


Built from https://develop.svn.wordpress.org/trunk@34848


git-svn-id: http://core.svn.wordpress.org/trunk@34813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:37:25 +00:00
Scott Taylor
0726babf36 Rewrite: add tests for add_rewrite_rule().
Props DrewAPicture.
See #16840.

Built from https://develop.svn.wordpress.org/trunk@34847


git-svn-id: http://core.svn.wordpress.org/trunk@34812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:36:25 +00:00
Scott Taylor
0c6ee34d00 REST API: add a utility function, mysql_to_rfc3339() to functions.php
Background:
6d0ad766ca

Props rmmcue.
See #33982.

Built from https://develop.svn.wordpress.org/trunk@34846


git-svn-id: http://core.svn.wordpress.org/trunk@34811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:19:25 +00:00
Scott Taylor
f8c3aca01c REST API: add JsonSerializable() compatibility interface for PHP <5.4 to compat.php
Props rmmcue.
See #33982.

Built from https://develop.svn.wordpress.org/trunk@34845


git-svn-id: http://core.svn.wordpress.org/trunk@34810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 02:56:24 +00:00
Scott Taylor
5a357a452f REST API: add json_last_error_msg() compatibility function for PHP <5.5 to compat.php
Props rmmcue.
See #33982.

Built from https://develop.svn.wordpress.org/trunk@34844


git-svn-id: http://core.svn.wordpress.org/trunk@34809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 02:45:26 +00:00
Drew Jaynes
22ab774617 Docs: Adjust the line wrap indentation on the $link parameter description for the wp_post_revision_title_expanded hook, introduced in [34842].
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34843


git-svn-id: http://core.svn.wordpress.org/trunk@34808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 01:30:25 +00:00
Helen Hou-Sandí
780926c161 Revisions: Add a wp_post_revision_title_expanded filter.
This allows for content to be added to revision lists, such as in the revisions metabox.

fixes #9681.

Built from https://develop.svn.wordpress.org/trunk@34842


git-svn-id: http://core.svn.wordpress.org/trunk@34807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 00:59:27 +00:00
Dominik Schilling
93a5af5753 Image Editor: Merge two error strings.
Props pavelevap.
See #22623.
Built from https://develop.svn.wordpress.org/trunk@34841


git-svn-id: http://core.svn.wordpress.org/trunk@34806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 22:40:25 +00:00
Jeremy Felt
ab5ea42aa2 MS: Pass context to get_header() and get_footer() in activation/signup.
Fixes #21712.

Built from https://develop.svn.wordpress.org/trunk@34840


git-svn-id: http://core.svn.wordpress.org/trunk@34805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 22:36:24 +00:00
Dominik Schilling
fcc36d1adf Media List Table: Remove the date display in column_parent().
It should be the time at which the post was written, but it was never because of the missing `$parent` argument.

Fixes #33238.
Built from https://develop.svn.wordpress.org/trunk@34839


git-svn-id: http://core.svn.wordpress.org/trunk@34804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 22:25:26 +00:00
Weston Ruter
0b93819465 Customizer: Ensure WP_Customize_Setting::update() returns boolean value.
Adds unit tests for `WP_Customize_Setting::save()` (and `WP_Customize_Setting::update()`), along with the actions `customize_update_{$type}`, and `customize_save_{$id_base}` which they trigger.

Fixes #34140.

Built from https://develop.svn.wordpress.org/trunk@34838


git-svn-id: http://core.svn.wordpress.org/trunk@34803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 21:58:24 +00:00
John Blackbourn
1e90e58da3 Correct pagination when viewing the 'Mine' link on the post listing screen.
Fixes #19609
Props ocean90

Built from https://develop.svn.wordpress.org/trunk@34837


git-svn-id: http://core.svn.wordpress.org/trunk@34802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 21:36:25 +00:00
John Blackbourn
ab413e89bf Include post__in as a value available to the orderby parameter in the docs for WP_Query::parse_query().
See #32246

Built from https://develop.svn.wordpress.org/trunk@34836


git-svn-id: http://core.svn.wordpress.org/trunk@34801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 20:58:29 +00:00
Weston Ruter
31a394fcf7 Customizer: Reset horizontal scroll position when finished dragging a nav menu item.
Props karinedo, austinginder, adamsilverstein, tyxla.
Fixes #33367.

Built from https://develop.svn.wordpress.org/trunk@34834


git-svn-id: http://core.svn.wordpress.org/trunk@34799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 20:46:27 +00:00
Helen Hou-Sandí
60431ae239 Permalinks: Slightly lengthen the truncated slug for display.
This brings it closer to the width of the input so there is less jumping around of buttons. We can afford the space now that other buttons in the space are typically no longer there.

fixes #18306.

Built from https://develop.svn.wordpress.org/trunk@34833


git-svn-id: http://core.svn.wordpress.org/trunk@34798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 19:29:24 +00:00
Drew Jaynes
3f747a6395 Revisions: Also pass the $revision post object to the wp_prepare_revision_for_js filter, introduced in [34541].
Props helen.
Fixes #28627.

Built from https://develop.svn.wordpress.org/trunk@34832


git-svn-id: http://core.svn.wordpress.org/trunk@34797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 18:33:28 +00:00
Drew Jaynes
a134491455 Docs: Document the $revision_data parameter passed to the wp_prepare_revision_for_js filter with a hash notation.
The hook was introduced in [34541].

See #28627.

Built from https://develop.svn.wordpress.org/trunk@34831


git-svn-id: http://core.svn.wordpress.org/trunk@34796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 18:03:26 +00:00
Weston Ruter
31d02887b6 Customizer: Fix moving focus to available nav menu items search.
Fixes regression introduced in [34219].

Props tyxla.
See #33360.
Fixes #34125 for trunk.

Built from https://develop.svn.wordpress.org/trunk@34829


git-svn-id: http://core.svn.wordpress.org/trunk@34794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 15:27:24 +00:00
Boone Gorges
0e7c1d3b14 Use wp_installing() instead of WP_INSTALLING constant.
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.

A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available.  However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.

The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.

Props boonebgorges, jeremyfelt.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34828


git-svn-id: http://core.svn.wordpress.org/trunk@34793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 15:06:28 +00:00
Drew Jaynes
aa6fbdaa92 Docs: Add a missing DocBlock summary for wp_list_widget_controls_dynamic_sidebar().
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34827


git-svn-id: http://core.svn.wordpress.org/trunk@34792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 03:06:24 +00:00
Drew Jaynes
b1b2ec30e2 Docs: Add missing DocBlock summaries for five functions in wp-admin/includes/template-functions.php.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34826


git-svn-id: http://core.svn.wordpress.org/trunk@34791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 03:03:25 +00:00
Drew Jaynes
0b332f6d7a Docs: Add missing DocBlock summaries to three functions in wp-admin/includes/plugin.php.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34825


git-svn-id: http://core.svn.wordpress.org/trunk@34790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 02:55:24 +00:00
Drew Jaynes
4c2203b370 Docs: Add missing summaries for functions in wp-admin/includes/misc.php.
Also restructures the summary for `update_home_siteurl()`.

See #32246.

Built from https://develop.svn.wordpress.org/trunk@34824


git-svn-id: http://core.svn.wordpress.org/trunk@34789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 02:52:24 +00:00
Drew Jaynes
2de4cc7149 Docs: Add missing DocBlock summaries for a multitude of functions in wp-admin/includes/media.php.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34823


git-svn-id: http://core.svn.wordpress.org/trunk@34788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 02:44:25 +00:00
Drew Jaynes
3866a8cf58 Docs: Add missing method summaries for the deprecated WP_User_Search class, including prepare_query(), query(), prepare_vars_for_template_usage(), do_paging(), and get_results().
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34822


git-svn-id: http://core.svn.wordpress.org/trunk@34787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 02:35:25 +00:00
Drew Jaynes
1f1c2335ad Docs: Add missing summaries for three deprecated admin functions: dropdown_categories(), dropdown_link_categories(), and wp_dropdown_cats().
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34821


git-svn-id: http://core.svn.wordpress.org/trunk@34786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 02:29:26 +00:00
Sergey Biryukov
a285a1cf22 Use home_url() instead of get_option( 'siteurl' ) in notifications that are sent when a user's email address or password is changed.
Props tyxla, ramay.
Fixes #34071.
Built from https://develop.svn.wordpress.org/trunk@34820


git-svn-id: http://core.svn.wordpress.org/trunk@34785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-04 23:03:26 +00:00
Jeremy Felt
a8771a3914 MS: Populate site_name property in a new WP_Network.
This allows us to reduce some extra handling in `ms-settings.php`. Requires [34777].

Props johnjamesjacoby for the initial patch.
See #31985.

Built from https://develop.svn.wordpress.org/trunk@34819


git-svn-id: http://core.svn.wordpress.org/trunk@34784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-04 20:51:25 +00:00
Drew Jaynes
6650dfea4f Docs: Document the plugin data array returned by get_plugin_data() with a hash-notation.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34818


git-svn-id: http://core.svn.wordpress.org/trunk@34783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-04 19:06:27 +00:00
Drew Jaynes
f6948c38fa Widgets: Add more tests for registering and unregistering sidebars with 1) no ID, 2) a string ID, 3) a numeric ID.
See #17078.

Built from https://develop.svn.wordpress.org/trunk@34817


git-svn-id: http://core.svn.wordpress.org/trunk@34782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-04 05:23:24 +00:00
Drew Jaynes
a0c6f8cca2 Widgets: Add tests for dynamic_sidebar() where sidebars were registered with 1) no supplied ID, 2) a numeric ID, 3) a string ID.
See #17078.

Built from https://develop.svn.wordpress.org/trunk@34816


git-svn-id: http://core.svn.wordpress.org/trunk@34781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-04 04:44:27 +00:00
Boone Gorges
1438ad7bb8 Rechristen the get_page_of_comment filter.
See [34808].

Props DrewAPicture, SergeyBiryukov.
Fixes #13939.
Built from https://develop.svn.wordpress.org/trunk@34815


git-svn-id: http://core.svn.wordpress.org/trunk@34780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 22:43:27 +00:00
Jeremy Felt
908b1f0b7d MS: Align HTML structure in wp-signup.php and wp-activate.php.
Assigns the `wp-activate-container` and `wp-signup-container` to the container inside `#signup-container` on each. This container already existed in `wp-signup.php` and is new in `wp-activate.php`.

Props ocean90.
Fixes #25478.

Built from https://develop.svn.wordpress.org/trunk@34814


git-svn-id: http://core.svn.wordpress.org/trunk@34779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 21:51:25 +00:00
Drew Jaynes
b453c9e976 Users: Don't pass the current WP_Users_List_Table or WP_MS_Users_List_Table instance to the users_list_table_query_args filter after all.
After some discussion, it was decided that Multisite vs single site context can just as easily be derived using available functions like `is_network_admin()`, `get_current_screen()`, etc., rendering the second parameter moot. The hook was introduced in [34796].

Fixes #25360.

Built from https://develop.svn.wordpress.org/trunk@34813


git-svn-id: http://core.svn.wordpress.org/trunk@34778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 21:49:24 +00:00
Boone Gorges
f08e5c2d80 Update the taxonomy relationship cache in is_object_in_term().
This function attempts to read from the relationship cache, and uses any data
it finds. If it finds no data, it does a query for the data it needs. Since we
are going to the trouble to query for the relationships, and since we are
already using cached data when available, let's go ahead and cache it for
later use.

Props joehoyle, boonebgorges.
Fixes #32044.
Built from https://develop.svn.wordpress.org/trunk@34812


git-svn-id: http://core.svn.wordpress.org/trunk@34777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 21:19:23 +00:00
Boone Gorges
5be41d618f Don't prime term meta cache in is_object_in_term().
Term meta is not necessary in this case, so priming the cache wastes a query.

See #10142, #32044.
Built from https://develop.svn.wordpress.org/trunk@34811


git-svn-id: http://core.svn.wordpress.org/trunk@34776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 21:07:24 +00:00
Drew Jaynes
c1fc5e79c8 Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods.
Renames `reset_permalinks()` to `set_permalink_structure()` (mimicking `$wp_rewrite->set_permalink_structure()`) and allows it to accept an optional permalink structure. In this way, we can double dip using it to both set and reset the permalink structure from anywhere.

Removes alot of duplicated code from tests.

See #33968.

Built from https://develop.svn.wordpress.org/trunk@34810


git-svn-id: http://core.svn.wordpress.org/trunk@34775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 20:55:24 +00:00
Boone Gorges
28625bfc38 When creating terms, avoid false dupe checks due to accented characters.
`wp_insert_term()` doesn't allow the creation of a term when the term `name`
is the same as another term in the same hierarchy level of the same taxonomy.
Previously, this duplicate check used `get_term_by( 'name' )`, which uses the
database collation to determine sameness. But common collations do not
distinguish between accented and non-accented versions of a character. As a
result, it was impossible to create a term 'Foo' if a sibling term with an
accented character existed.

We address this problem by using `get_terms()` to do the duplicate check. This
query returns all potentially matching terms. We then do a stricter check
for equivalence in PHP, before determining whether one of the matches is
indeed a duplicate.

Props boonebgorges, tyxla, geza.miklo, mehulkaklotar.
Fixes #33864.
Built from https://develop.svn.wordpress.org/trunk@34809


git-svn-id: http://core.svn.wordpress.org/trunk@34774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 20:25:26 +00:00
Boone Gorges
32dda547c1 Introduce 'page_of_comment' filter.
This filter allows developers to modify the output of `get_page_of_comment()`.

As a side effect of this new filter, comment page numbers will always be
returned as integers. Previously, they would sometimes be returned as floats -
eg `float(2.0)` instead of `int(2)`.

Props laceous.
See #13939.
Built from https://develop.svn.wordpress.org/trunk@34808


git-svn-id: http://core.svn.wordpress.org/trunk@34773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 19:39:25 +00:00
Drew Jaynes
6f2d3fea3b Tests: Last try: It's redundant to reset permalinks on tearDown() if we're already doing it on every setUp().
Removes the restoration logic, which leveraged a static property initialized with `get_option()`.

See #33968.

Built from https://develop.svn.wordpress.org/trunk@34807


git-svn-id: http://core.svn.wordpress.org/trunk@34772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 19:27:26 +00:00
Boone Gorges
25e7ad64cf Use 'comments_per_page' option as fallback in get_page_of_comment().
The function now uses the following order of precedence when calculating
comment pagination: 1. the 'per_page' value passed in the `$args` array,
2. the 'comments_per_page' query var in `$wp_query`, and 3. the
'comments_per_page' setting from options-discussion.php. This change allows
`get_page_of_comment()` to return an accurate value before the main query
has been run.

Props laceous.
See #13939.
Built from https://develop.svn.wordpress.org/trunk@34806


git-svn-id: http://core.svn.wordpress.org/trunk@34771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 19:26:24 +00:00
Boone Gorges
cd5cd380e8 Only count top-level comments when calculating threaded pagination.
The change in [34535] did not properly account for threading.

See #13939, #11334.
Built from https://develop.svn.wordpress.org/trunk@34805


git-svn-id: http://core.svn.wordpress.org/trunk@34770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 19:16:24 +00:00
Boone Gorges
198dee542d Ensure that WP_User_Query vars are filled after 'pre_get_users'.
This prevents notices from being thrown when a 'pre_get_users' callback
removes required values from the list of `query_vars`.

For backward compatibility with previous uses of 'pre_get_users', default
values are parsed both before and after the action is fired.

Fixes #33449.
Built from https://develop.svn.wordpress.org/trunk@34804


git-svn-id: http://core.svn.wordpress.org/trunk@34769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 18:45:25 +00:00
Drew Jaynes
86f8dedf68 Tests: Move the global permalinks reset routine to only fire when running core tests.
Should fix intermittent mysqli response errors in the AJAX tests.

See #33968.

Built from https://develop.svn.wordpress.org/trunk@34803


git-svn-id: http://core.svn.wordpress.org/trunk@34768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 18:36:26 +00:00
Drew Jaynes
a127d95c89 Tests: Introduce WP_UnitTestCase::reset_permalinks(), an attempt to DRY up logic for resetting and restoring default permalinks on setUp() and tearDown().
See #33968.

Built from https://develop.svn.wordpress.org/trunk@34802


git-svn-id: http://core.svn.wordpress.org/trunk@34767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 17:15:24 +00:00