* Create an abstract `WP_UnitTestCase_Base` class to share between PHPUnit 7.x and older versions.
* Add a speed-trap loader to determine which `SpeedTrapListener` class needs to be loaded for the current PHPUnit version.
* Remove unnecessary `PHPUnit\Util\Test` and `PHPUnit_Util_Getopt` inheritances.
* Update Travis CI config to use PHPUnit 7.x for PHP 7.1, 7.2, and nightly PHP versions.
Props jipmoors, netweb, desrosj, ayeshrajans, soulseekah, SergeyBiryukov.
See #43218.
git-svn-id: https://develop.svn.wordpress.org/trunk@44701 602fd350-edb4-49c9-b593-d223f7449a82
Moves the logic for determining when an event will next run from `wp_next_scheduled()` to `wp_get_scheduled_event()`.
This improves the performance of `wp_get_scheduled_event()` by avoiding duplicate function calls and object cache hits.
Props peterwilsoncc.
Fixes#45976.
git-svn-id: https://develop.svn.wordpress.org/trunk@44693 602fd350-edb4-49c9-b593-d223f7449a82
Bypass adding a `rel` attribute when the `wp_targeted_link_rel` filter returns an empty string or other falsy result.
Props mcmwebsol, spartank, meatman89fs.
Fixes#45352.
git-svn-id: https://develop.svn.wordpress.org/trunk@44691 602fd350-edb4-49c9-b593-d223f7449a82
This was introduced in [44466]. Also, this changeset adds tests for `_wp_die_process_input()` so that this never happens again.
Props dd32.
See #45933.
git-svn-id: https://develop.svn.wordpress.org/trunk@44690 602fd350-edb4-49c9-b593-d223f7449a82
Meta capability mapping doesn't recurse through multiple meta definitions, which creates a situation where the capabilities test is looking for the non-existent primitive capability `edit_blocks`, which should instead be mapped to `edit_posts`.
Defining the `edit_posts` capability when the `wp_block` post type is registered causes this check to change to to the `edit_posts` capability.
Props aduth.
Fixes#45373.
git-svn-id: https://develop.svn.wordpress.org/trunk@44687 602fd350-edb4-49c9-b593-d223f7449a82
The taxonomy should be passed as part of `$args`, rather than as its own argument.
Props birgire.
Fixes#45297.
git-svn-id: https://develop.svn.wordpress.org/trunk@44686 602fd350-edb4-49c9-b593-d223f7449a82
The customiser assumes that `<area>` tags will have a `href` attribute, which isn't necessarily true. Now it checks instead of assuming.
Props janthiel, adamsilverstein.
Fixes#45053.
git-svn-id: https://develop.svn.wordpress.org/trunk@44684 602fd350-edb4-49c9-b593-d223f7449a82
This also updates the option label, to clarify that it needs to be enabled for comment cookies to work.
Props azaozz, pento, dhavalkasvala, desrosj, pputzer, mirkoschubert, ThemeZee.
Fixes#44736.
git-svn-id: https://develop.svn.wordpress.org/trunk@44683 602fd350-edb4-49c9-b593-d223f7449a82
If the commenter doesn't have cookies set, they won't see the comment preview again. Showing an expanded message will help offset any confusion if they revisit the site later, and their comment is still in moderation, but they can't see it anymore.
Props azaozz, pento.
Fixes#44736.
git-svn-id: https://develop.svn.wordpress.org/trunk@44681 602fd350-edb4-49c9-b593-d223f7449a82
An error is triggered if a Menu Name isn't given when the user attempts to create a menu. When they go back and add a name, the error styling can be removed.
Props ashokrd2013, piyush9100, welcher, afercia.
Fixes#42321.
git-svn-id: https://develop.svn.wordpress.org/trunk@44680 602fd350-edb4-49c9-b593-d223f7449a82
The theme uses JavaScript to check if a right-aligned blockquote is below the sidebar content before pushing it outside of the content area. This was originally only firing on browser resize.
Fixes#40103.
git-svn-id: https://develop.svn.wordpress.org/trunk@44679 602fd350-edb4-49c9-b593-d223f7449a82
The `get_header()`, `get_footer()`, `get_sidebar()`, and `get_template_part()` functions all call `locate_template()` as their final action, which returns the name of the template being loaded. Returning this value helps handle problems with templates being loaded.
Props tferry.
Fixes#40969.
git-svn-id: https://develop.svn.wordpress.org/trunk@44678 602fd350-edb4-49c9-b593-d223f7449a82
This allows more accurate filtering of the filename and extension given to uploaded files.
Props desrosj, Tkama.
Fixes#45707.
git-svn-id: https://develop.svn.wordpress.org/trunk@44677 602fd350-edb4-49c9-b593-d223f7449a82
Introduces `Language_Pack_Upgrader::clear_destination()` to clear existing translations before installing new translations. Ensures that unused translations in JSON format are cleaned up.
Props dd32, swissspidy, ocean90.
Fixes#45468.
git-svn-id: https://develop.svn.wordpress.org/trunk@44676 602fd350-edb4-49c9-b593-d223f7449a82
The `WP_Shutdown_Handler` name plus related function names were premature when originally committed, as there can be multiple shutdown handlers in PHP, and WordPress makes use of that feature. This changeset modifies the name to a more appropriate `WP_Fatal_Error_Handler`, and related to that changes the following names:
* The drop-in to override the handler is now called `fatal-error-handler.php`.
* The internal function `wp_register_premature_shutdown_handler` is now called `wp_register_fatal_error_handler()`.
In addition to these naming changes, a new constant `WP_DISABLE_FATAL_ERROR_HANDLER` is introduced that can be set in `wp-config.php` to entirely disable the fatal error handler. That constant's value is and should be accessed indirectly via a new `wp_is_fatal_error_handler_enabled()` function and is filterable via a new `wp_fatal_error_handler_enabled` hook. Note that disabling the fatal error handler will skip the new functionality entirely, including the potentially used `fatal-error-handler.php` drop-in.
The new set of constant, filter and function provide for an easier-to-use mechanism to disable the fatal error handler altogether, rather than requiring developers to implement a drop-in for purely that purpose.
Props afragen, flixos90, joyously, knutsp, markjaquith, ocean90, schlessera, spacedmonkey.
Fixes#46047. See #44458.
git-svn-id: https://develop.svn.wordpress.org/trunk@44674 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds support for a new `wp_die()` argument `exit`, which defaults to true and determines whether `wp_die()` should actually terminate the request. The new fatal error handler then calls `wp_die()` with that argument set to false, as calling `die()` or `exit` from a PHP shutdown function prevents other shutdown functions from being called.
Props schlessera, johnbillion.
Fixes#46038. See #44458.
git-svn-id: https://develop.svn.wordpress.org/trunk@44671 602fd350-edb4-49c9-b593-d223f7449a82
The theme's `object-fit: cover` styles for the header caused YouTube videos to be positioned too far left in Safari.
Fixes#40522.
git-svn-id: https://develop.svn.wordpress.org/trunk@44669 602fd350-edb4-49c9-b593-d223f7449a82
Prior to this change, each `wp_die()` handler had their own logic for how to parse arguments, causing inconsistencies and even breakage because the arguments possible to pass to `wp_die()` depended on the request context. Passing a `WP_Error` as `$message` for example used to be only support by the default handler, but not the AJAX and XML-RPC handlers.
With the fatal error protection, plus the new `wp_die()` handlers related to that, improving this support and compatibility has become more significant. Therefore this changeset introduces a private `_wp_die_process_input()` function that handles all function parameters consistently.
Props spacedmonkey, flixos90, schlessera.
Fixes#45933. See #44458.
git-svn-id: https://develop.svn.wordpress.org/trunk@44666 602fd350-edb4-49c9-b593-d223f7449a82
This de-duplicates the content, so it only needs to be modified in one place.
Additionally, we now link to the NPM/Grunt install guides on the build instructions page.
Props pento, ocean90.
Fixes#43732.
git-svn-id: https://develop.svn.wordpress.org/trunk@44664 602fd350-edb4-49c9-b593-d223f7449a82
Adds a `maybe_serialize()` comparison for the old and new values in `update_network_option()` to avoid unnecessary database writes when options contain identical objects.
Props bor0.
Fixes#44956.
git-svn-id: https://develop.svn.wordpress.org/trunk@44662 602fd350-edb4-49c9-b593-d223f7449a82
The Gallery Widget incorrectly tried to include the deleted image in the preview.
Props westonruter, janak007, afercia, mrasharirfan.
Fixes#43139.
git-svn-id: https://develop.svn.wordpress.org/trunk@44661 602fd350-edb4-49c9-b593-d223f7449a82
Their respective `post_category` and `post_categories` parameters were not correct.
Props Takahashi_Fumiki.
Fixes#45171.
git-svn-id: https://develop.svn.wordpress.org/trunk@44660 602fd350-edb4-49c9-b593-d223f7449a82
The "Your comment is awaiting moderation." message relied upon the comment author cookie being set. However, since it's now possible to opt-out of that cookie, submitting a comment won't show the comment preview when the comment is placed in moderation.
To avoid this issue, we now include a hash in the redirect URL, allowing the site to identify that a preview of the moderated comment should be displayed.
Props imath, tomdxw, birgire, lakenh, azaozz, pento.
Fixes#43857.
git-svn-id: https://develop.svn.wordpress.org/trunk@44659 602fd350-edb4-49c9-b593-d223f7449a82
In the non-latin font fallback styles, languages using the Devanagari alphabet were initially committed in a comma-separated list in the `:lang()` selector, which isn't fully supported. This update separates those languages into their own `:lang()` selectors.
Props mako09.
Fixes#45731.
git-svn-id: https://develop.svn.wordpress.org/trunk@44657 602fd350-edb4-49c9-b593-d223f7449a82