`get_term_by()` always returns a single term, even when more than one term
matches the query parameters. The new note warns developers to use
`get_terms()` when such ambiguity may result.
Fixes#36878.
git-svn-id: https://develop.svn.wordpress.org/trunk@37656 602fd350-edb4-49c9-b593-d223f7449a82
When custom pagination parameters are passed to `wp_list_comments()`, a
secondary query must be performed to fetch the proper comments. See [36157].
This query should show comments of the same `comment_status` as the default
query initialized in `comments_template()`: show only comments that are
approved, or those that are unapproved but belong to the current user.
Props smerriman.
Fixes#37048.
git-svn-id: https://develop.svn.wordpress.org/trunk@37655 602fd350-edb4-49c9-b593-d223f7449a82
To ensure a clean run, the test suite drops all tables before installing, by simply looping over the table list and dropping them if they exist. This works well for Core, but may fail when a plugin has created a table with foreign key constraints in a previous test run.
Many plugins choose to base their test suite on the Core setup, so making life easier for them is a plus, even if Core doesn't directly need this change.
Props javorszky.
Fixes#37046.
git-svn-id: https://develop.svn.wordpress.org/trunk@37654 602fd350-edb4-49c9-b593-d223f7449a82
Defer to the new `get_sites()` replacement, offering fresh (...or cached) `WP_Site` objects via the new `WP_Site_Query`.
Props flixos90.
Fixes#36994.
git-svn-id: https://develop.svn.wordpress.org/trunk@37653 602fd350-edb4-49c9-b593-d223f7449a82
Full `WP_Site` objects should be expected from `get_site()` rather than arrays.
In the single (soon to be deprecated) use of arrays for this in core, we can cast the result to `(array)` for back-compat.
See #35791.
git-svn-id: https://develop.svn.wordpress.org/trunk@37652 602fd350-edb4-49c9-b593-d223f7449a82
Whenever package.json or Gruntfile.js is updated, we should assume that it affects everything and run the full monty of tasks.
Fixes#36528.
Props iseulde.
git-svn-id: https://develop.svn.wordpress.org/trunk@37650 602fd350-edb4-49c9-b593-d223f7449a82
`term_id` and `term_taxonomy_id` become offset when running the entire test
suite.
Introduced in [37647].
See #37009.
git-svn-id: https://develop.svn.wordpress.org/trunk@37649 602fd350-edb4-49c9-b593-d223f7449a82
The change can cause fatal errors under certain conditions, like when the subclass has a different function signature for `widget()` or doesn't even implement the method.
See #35981.
git-svn-id: https://develop.svn.wordpress.org/trunk@37648 602fd350-edb4-49c9-b593-d223f7449a82
Move the REST API JSONP callback validation check into a separate function named `wp_check_jsonp_callback()`. This allows plugins to use the built-in validation when handling JSONP callbacks.
Extremely Important Note: If you send JSONP in your custom response, make sure you prefix the response with `/**/`. This will mitigate the Rosetta Flash exploit. You should also send the `X-Content-Type-Options:nosniff` header, or even better, use the REST API infrastructure.
Props rmccue.
Fixes#28523.
git-svn-id: https://develop.svn.wordpress.org/trunk@37646 602fd350-edb4-49c9-b593-d223f7449a82
The new class-walker-nav-menu.php file is loaded in nav-menu-template.php for backward compatibility purposes.
Fixes#37035. See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@37640 602fd350-edb4-49c9-b593-d223f7449a82
For PHP 5.2, SPL can be disabled. As SPL provides the support for multiple autoloaders, this needs to be shimmed if not available.
Fixes#36926.
git-svn-id: https://develop.svn.wordpress.org/trunk@37636 602fd350-edb4-49c9-b593-d223f7449a82
Avoids a PHP notice since `Language_Pack_Upgrader_Skin::before()` tries to access a non-existent update.
Also, change the `up_to_date` string to use the plural form because translations are only updated in bulk mode.
Fixes#36615.
git-svn-id: https://develop.svn.wordpress.org/trunk@37635 602fd350-edb4-49c9-b593-d223f7449a82
[37623] used the wrong parameter name (count=true instead of fields=count).
For greater flexibility and forward compatibility with other potential changes
to the return value of `get_terms()`, we now do a looser check: any non-array
value is excluded from the filter.
Fixes#36992.
git-svn-id: https://develop.svn.wordpress.org/trunk@37634 602fd350-edb4-49c9-b593-d223f7449a82
Different tests are used for subdomain and subdirectory installs as domain and path are searched differently for each. Only trailing wildcard searches are tested because leading wildcards are not yet supported.
See #36675.
git-svn-id: https://develop.svn.wordpress.org/trunk@37633 602fd350-edb4-49c9-b593-d223f7449a82
- We already match URLs on their own line, add another regex to match URLs in their own paragraphs.
- Always exclude the `\s<>"` characters when matching.
- Add more unit tests.
Props iseulde, azaozz.
Fixes#25387.
git-svn-id: https://develop.svn.wordpress.org/trunk@37627 602fd350-edb4-49c9-b593-d223f7449a82
Non web interfaces with WordPress (such as wp-cli) need to be able to bypass certain checks in the bootstrap process. This introduces three new filters to allow for those checks to be skipped.
1. Provides a way of forcefully bypassing wp_maintenance().
2. Provides a way of forcefully bypassing wp_debug_mode(). See https://github.com/wp-cli/wp-cli/issues/177
3. Provide a way of forcefully skipping loading wp-content/advance-cache.php. See https://github.com/wp-cli/wp-cli/pull/164
These filters should not be used by plugins (in fact, they run before plugins are loaded, so they can't be used by plugins). In general, they should only be used in non-web interactions with WordPress.
See #34936.
Props jorbin, DrewAPicture.
git-svn-id: https://develop.svn.wordpress.org/trunk@37626 602fd350-edb4-49c9-b593-d223f7449a82
Hierarchical comment queries work by first fetching the IDs of top-level
comments, and then filling the descendant tree one level at a time based on the
top-level results. When top-level comment IDs are found in the cache,
`WP_Comment_Query` does not generate the SQL used to fetch these comments. In
this case, the `fill_descendants()` query does not have enough information
to fill children. As a result, descendant comments were failing to be filled
in cases where the top-level comments were found in the cache.
This was a minor bug previously, because comment caches were not maintained
between pageloads. Since comment caches are now persistent [37613], the problem
becomes evident anywhere that a persistent object cache is in use.
The solution is to cache parent-child relationships, so that when top-level
comments are found in the cache, descendant comments should be found there as
well.
Fixes#36487.
git-svn-id: https://develop.svn.wordpress.org/trunk@37625 602fd350-edb4-49c9-b593-d223f7449a82
Use of the 'get_terms' filter was consolidated in [37572], with the
introduction of `WP_Term_Query`. At that time, the result of 'count=true'
queries began being filtered by 'get_terms'. This breaks existing 'get_terms'
callbacks, which often assume that the returned value will be an array or a
`WP_Error` object.
Props JustinSainton.
Fixes#36992.
git-svn-id: https://develop.svn.wordpress.org/trunk@37623 602fd350-edb4-49c9-b593-d223f7449a82
`get_sites()` is now used in:
* `domain_exists()`
* `wp_update_network_site_counts()`
* `get_blog_id_from_url()`
Props spacedmonkey, jeremyfelt.
See #35791.
git-svn-id: https://develop.svn.wordpress.org/trunk@37620 602fd350-edb4-49c9-b593-d223f7449a82
When a site is added, updated, or deleted, the `site_ids` cache for a query will no longer be reliable. Bumping `last_changed` will force a new query for site IDs.
See #35791.
git-svn-id: https://develop.svn.wordpress.org/trunk@37618 602fd350-edb4-49c9-b593-d223f7449a82
`get_sites()` should be considered a replacement for `wp_get_sites()`. Backward compatibility is maintained in the meantime by using `get_site()` to populate the return data with associative arrays rather than `WP_Site` objects.
Props spacedmonkey, flixos90.
See #35791.
git-svn-id: https://develop.svn.wordpress.org/trunk@37617 602fd350-edb4-49c9-b593-d223f7449a82
Previously, only the 'last_changed' incrementor was manually invalidated, since
the newly created comment did not yet exist in the cache. However, this created
an inconsistency with the other comment CRUD functions, which result in the
'clean_comment_cache' action firing.
Props spacedmonkey.
See #36906.
git-svn-id: https://develop.svn.wordpress.org/trunk@37614 602fd350-edb4-49c9-b593-d223f7449a82
'comment' was made non-persistent in [7986], to address the difficulty of
reliable cache invalidation. Since then, the comment system has improved such
that we can be more confident that caches are being busted as needed.
Props spacedmonkey.
Fixes#36906.
git-svn-id: https://develop.svn.wordpress.org/trunk@37613 602fd350-edb4-49c9-b593-d223f7449a82
This update adds two main features for your WordPress development happiness.
1) GitHub URL support. You can now use `grunt patch:https://github.com/aaronjorbin/develop.wordpress/pull/3` with any copy of WordPress on GitHub. No longer will you need to download the patch manually. Works for both core and develop mirrors on GitHub.
2) Upload patches directly from the command line. No longer will you need to create a patch and manually upload it to trac. `grunt upload_patch:20000` will upload a patch to the appropriate ticket after a user enters a WordPress.org username and password. This is limited to users with the appropriate XML-RPC privileges in trac (right now, that is just bug gardeners). You still need to manually add the `has patch` keyword.
Full changelog: https://github.com/aaronjorbin/grunt-patch-wordpress/compare/0.3.0...0.4.0Fixes#35917.
Props netweb, ericlewis, michaelbeil, jorbin.
git-svn-id: https://develop.svn.wordpress.org/trunk@37612 602fd350-edb4-49c9-b593-d223f7449a82
The current orange and red used for the radio button labels in the Edit Comment
"Status" box don't have a sufficient color contrast ratio with the background.
Removing the colors improves accessibility and consistency.
See #35659, #35622.
Fixes#36967.
git-svn-id: https://develop.svn.wordpress.org/trunk@37611 602fd350-edb4-49c9-b593-d223f7449a82
By moving the Details sidebar after the attachments grid, the tab order is
greatly improved for keyboard users and matches the logical and visual order.
Fixes#36909.
git-svn-id: https://develop.svn.wordpress.org/trunk@37610 602fd350-edb4-49c9-b593-d223f7449a82