Commit Graph

39121 Commits

Author SHA1 Message Date
Sergey Biryukov e4813189c3 Build/Test Tools: Reorder `<file>` and `<exclude>` rules in `multisite.xml` to avoid warnings in PHPUnit 7.2+.
Missed in [44702].

See #43218.

git-svn-id: https://develop.svn.wordpress.org/trunk@44704 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-28 17:19:14 +00:00
Sergey Biryukov 48070a45a9 Build/Test Tools: Correct `WP_Test_REST_Schema_Sanitization::test_type_string()` to check for both `1.1` float and `'1.10'` string explicitly.
Previously, the test only passed due to a bug in PHPUnit 7.1.x and older versions.

Fixes #43218. See #38586.

git-svn-id: https://develop.svn.wordpress.org/trunk@44703 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-28 16:53:14 +00:00
Sergey Biryukov 6d8637097a Build/Test Tools: Reorder `<file>` and `<exclude>` rules in `phpunit.xml.dist` to avoid warnings in PHPUnit 7.2+.
Remove deprecated `logIncompleteSkipped` option that does not exist in PHPUnit 6.0+.

See #43218.

git-svn-id: https://develop.svn.wordpress.org/trunk@44702 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-28 15:54:47 +00:00
Sergey Biryukov 001c6498e8 Build/Test Tools: Add support for PHPUnit 7.x.
* 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
2019-01-28 14:10:24 +00:00
Dominik Schilling (ocean90) 639f66aade Install/Upgrade: After [44451], update translator comments to include the new placeholder.
See #46111.
Fixes #45574.

git-svn-id: https://develop.svn.wordpress.org/trunk@44700 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-27 14:45:42 +00:00
Dominik Schilling (ocean90) fd5f5ae82e TinyMCE Classic Block: Remove unused variable.
See #46071.

git-svn-id: https://develop.svn.wordpress.org/trunk@44699 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-26 12:58:11 +00:00
Dominik Schilling (ocean90) d763cdf82c REST API: Prevent translating the hook name in a `_doing_it_wrong()` message by using a placeholder.
See #45265.

git-svn-id: https://develop.svn.wordpress.org/trunk@44698 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-26 12:28:15 +00:00
Andrew Ozz e01f30ae20 TinyMCE Classic Block: fix repositioning of the inline toolbar on scrolling.
Props iseulde, azaozz.
Fixes #46062.

git-svn-id: https://develop.svn.wordpress.org/trunk@44697 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-24 11:23:28 +00:00
Andrew Ozz 3b14a06c8c TinyMCE Classic Block: fix the Advanced Link modal (accessible when clicking on the cogwheel in the inline link modal in a Classic Block).
Fixes #46071.

git-svn-id: https://develop.svn.wordpress.org/trunk@44696 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-24 11:20:25 +00:00
Andrew Ozz 86d04a546f TinyMCE Classic Block: fix the Edit Image modal to work as in the Classic Editor.
Fixes #46085.

git-svn-id: https://develop.svn.wordpress.org/trunk@44695 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-24 11:10:34 +00:00
Peter Wilson ad0a1a2f82 Docs: Correct documentation for the `schedule_event` filter.
The filter runs for both recurring and single events.

See #42505.


git-svn-id: https://develop.svn.wordpress.org/trunk@44694 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-23 23:22:23 +00:00
Peter Wilson 554ee5b53c Cron: Move logic for finding the next event's timestamp.
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
2019-01-23 23:07:39 +00:00
Peter Wilson 8f94eec53c Plugins: Update docs for individual plugin loaded actions.
Corrects documentation to indicate the full path is passed to each action.

Fixes #41346.


git-svn-id: https://develop.svn.wordpress.org/trunk@44692 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-23 03:38:19 +00:00
Peter Wilson bb463b5265 Formatting: Prevent `wp_targeted_link_rel()` adding an empty attribute.
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
2019-01-22 21:54:26 +00:00
Felix Arntz fbe0605156 Bootstrap/Load: Fix fatal error when passing a `WP_Error` to `wp_die()`.
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
2019-01-22 08:51:56 +00:00
Gary Pendergast 687590d898 Post WordPress 5.1 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@44689 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-22 00:56:06 +00:00
Gary Pendergast 31bb707fb6 WordPress 5.1 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@44688 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-22 00:38:42 +00:00
Gary Pendergast 9bd6c81d1f Blocks: Define the `edit_posts` capability on the `wp_block` post type.
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
2019-01-22 00:04:22 +00:00
Gary Pendergast 804cb23503 Menus: Fix a deprecated call to `get_terms()`.
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
2019-01-21 23:37:57 +00:00
Gary Pendergast 09066df1cf Menus: Show an appropriate message when no menus exist.
Props garrett-eclipse.
Fixes #45155.



git-svn-id: https://develop.svn.wordpress.org/trunk@44685 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 23:31:45 +00:00
Gary Pendergast 5e77c07a2e Customiser: Prevent JS errors when previewing pages with an `<area>` tag.
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
2019-01-21 23:02:39 +00:00
Gary Pendergast d70c159c96 Comments: Default the `show_comments_cookies_opt_in` checkbox to enabled.
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
2019-01-21 22:56:31 +00:00
John Blackbourn dba1a0f436 Bootstrap/Load: Update the `@since` entry for `wp_die()`.
See #46038


git-svn-id: https://develop.svn.wordpress.org/trunk@44682 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 22:51:07 +00:00
Gary Pendergast db4f745581 Comments: Update the message shown when a comment is awaiting moderation.
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
2019-01-21 22:45:51 +00:00
Gary Pendergast f5b136b0a7 Menus: Remove error styling when the user addresses the error.
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
2019-01-21 22:09:48 +00:00
laurelfulford 3f7881b77a Twenty Seventeen: Update blockquote alignment on load.
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
2019-01-21 22:07:33 +00:00
Gary Pendergast f91ac658fe Themes: Return the value of `locate_template()` in functions that call it.
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
2019-01-21 21:59:44 +00:00
Gary Pendergast 1d2153b0c1 Media: Add a `$real_mime` parameter to the `wp_check_filetype_and_ext` filter.
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
2019-01-21 21:51:29 +00:00
Dominik Schilling (ocean90) 4052571ed7 I18N: Enable `clear_destination` in upgrader for updating/installing language packs.
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
2019-01-21 21:12:23 +00:00
Dominik Schilling (ocean90) 51726c6092 I18N: Remove JSON translations when deleting a theme or a plugin.
See #29860.
Fixes #45467.

git-svn-id: https://develop.svn.wordpress.org/trunk@44675 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 20:40:56 +00:00
Felix Arntz 2caa621b0d Bootstrap/Load: Change `shutdown handler` naming to final `fatal error handler` and allow disabling the handler entirely via a constant.
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
2019-01-21 20:14:56 +00:00
Felix Arntz 43bbbbf8b8 Bootstrap/Load: Fix bug causing AJAX functions to return a 500 when passing a `null` response to `wp_die()`.
This bug was introduced in [44497].

Props ocean90.
See #45933.


git-svn-id: https://develop.svn.wordpress.org/trunk@44673 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 20:06:24 +00:00
Sergey Biryukov 44ce02e28a PHPCS: Fix formatting issues introduced in [44670].
See #44914.

git-svn-id: https://develop.svn.wordpress.org/trunk@44672 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 19:56:47 +00:00
Felix Arntz 50d4abc949 Bootstrap/Load: Ensure that the fatal error shutdown handler does not prevent other shutdown handlers from being called.
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
2019-01-21 19:09:23 +00:00
Sergey Biryukov 8fe01c0621 Post Formats: Prevent Bulk Edit from unintentionally changing post format to Standard even if set to "No change".
Correct the logic in [41187].

Props birgire, mukesh27, lanche86.
Fixes #44914. See #41396.

git-svn-id: https://develop.svn.wordpress.org/trunk@44670 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 18:04:55 +00:00
laurelfulford 95c496b39e Twenty Seventeen: Prevent YouTube videos from being cut off in Safari.
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
2019-01-21 18:02:58 +00:00
Jonathan Desrosiers c0a1cf27e6 Privacy: Include request counts inline with the filters in the list table views.
Fixes $44952
Props eArtboard, pratikkry, birgire, garrett-eclipse.

git-svn-id: https://develop.svn.wordpress.org/trunk@44668 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 17:35:00 +00:00
Sergey Biryukov 59e31e0e4d Docs: Correct type and description for the first parameter of `set-screen-option` filter.
Props pbiron, burhandodhy.
Fixes #44850.

git-svn-id: https://develop.svn.wordpress.org/trunk@44667 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 16:07:40 +00:00
Felix Arntz 562ef09446 Bootstrap/Load: Support `WP_Error` and `$args` passed to `wp_die()` consistently in all handlers.
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
2019-01-21 16:01:53 +00:00
Sergey Biryukov 8b4330bb6e I18N: Update translator comment for the notice displayed when viewing the block editor with JavaScript disabled.
A URL in the comment creates an impression that the link is not translatable.

See #45453, #45856.

git-svn-id: https://develop.svn.wordpress.org/trunk@44665 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 13:53:33 +00:00
Gary Pendergast b7794e63ce Dev Tools: Load the `wp-admin` build instructions from `src`.
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
2019-01-21 04:59:55 +00:00
Gary Pendergast 5d7089f5bf Terms: Show error colours when a term fails to update.
Props birgire, afercia, jaymanpandya.
Fixes #43703.



git-svn-id: https://develop.svn.wordpress.org/trunk@44663 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 04:49:06 +00:00
Peter Wilson 7d8ce1e287 Options: Avoid unnecessary DB calls when updating network options.
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
2019-01-21 04:26:33 +00:00
Gary Pendergast 02422aab1d Widgets: Fix Gallery Widget preview after an image is deleted.
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
2019-01-21 04:12:10 +00:00
Gary Pendergast 3ea21b66d8 Docs: Improve the docblocks for `wp_insert_post()` and `wp_set_post_categories()`.
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
2019-01-21 01:44:49 +00:00
Gary Pendergast 9dfde992ee Comments: Show the "awaiting moderation" message when comment cookies are disabled.
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
2019-01-21 01:33:50 +00:00
Gary Pendergast 19645a4790 Tests: Add tests for the `__return*()` functions.
Props pbearne, mukesh27.
Fixes #46043.



git-svn-id: https://develop.svn.wordpress.org/trunk@44658 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 00:32:33 +00:00
laurelfulford 192224a46e Twenty Nineteen: Create separate `:lang()` selectors for Devanagari.
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
2019-01-20 20:22:05 +00:00
Felix Arntz f518dea0bc Upgrade/Install: Make `version_compare()` calls for plugin required version checks more robust.
Props afragen.
Fixes #46024. See #43986.


git-svn-id: https://develop.svn.wordpress.org/trunk@44656 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-20 12:02:02 +00:00
Andrea Fercia 6dde7cd74f Build/Test Tools: Update QUnit index file after [43174].
Updates the last occurrence of "(opens in a new window)" to "(opens in a new tab)".

See #43803.


git-svn-id: https://develop.svn.wordpress.org/trunk@44655 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-19 15:27:11 +00:00