Commit Graph

12731 Commits

Author SHA1 Message Date
Felix Arntz
30d5ca9172 Bootstrap/Load: Fix workaround to display admin link in PHP error template by introducing $link_url and $link_text arguments to wp_die().
This changeset removes the hack that was used before to display more complex HTML markup than a simple message in the default PHP error template via `wp_die()`. By removing HTML markup from the arguments passed to `wp_die()` it furthermore paves the way for supporting other content types than the default.

The message and arguments can be modified with new `wp_php_error_message` and `wp_php_error_args` filters respectively.

Furthermore this changeset fixes a few issues of functions not existing which could potentially have caused fatal errors when executed early in the WordPress bootstrap process.

Props flixos90, spacedmonkey.
See #45933, #44458.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 15:21:50 +00:00
Felix Arntz
225f3055b8 Bootstrap/Load: Only pause extensions when they cause a crash on a protected endpoint.
This is a first step on pausing extensions less aggressively. If a plugin or theme only causes a crash in the frontend, there is no point in pausing it in the admin backend.

See #45940, #44458.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 14:05:00 +00:00
Felix Arntz
a6ec40d65d Bootstrap/Load: Use wp_load_translations_early() when Translation API is not yet loaded.
Props spacedmonkey.
Fixes #45932. See #44458.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 13:34:52 +00:00
Andrea Fercia
da760d1ecf Taxonomy: Remove extra padding around buttons on term edit page.
Props monikarao, mukesh27, chetan200891.
See #9777.
Fixes #45183.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 12:59:52 +00:00
Gary Pendergast
077af6e47d Docs: Improve the sanitize_email filter.
- Remove duplicate parameter names.
- Fix the wrong value being passed in the second parameter.
- Correct the type of the `$message` parameter.

Props ChriCo.
Fixes #45595.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 06:16:49 +00:00
Gary Pendergast
8c702e04f3 Rewrite: Remove extra arguments being passed to WP_Rewrite::iis7_url_rewrite_rules().
Props rafsuntaskin.
Fixes #44185.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 06:10:50 +00:00
Gary Pendergast
0bbb277ee4 Formatting: Add type checking to _sanitize_text_fields().
When a non-string value is passed, return an empty string.

Props Mte90.
Fixes #41450.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 06:05:49 +00:00
Gary Pendergast
63cbfcbded Plugin Editor: Disable the documentation look up button when no function is selected.
Props xkon.
Fixes #41143.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 06:01:50 +00:00
Gary Pendergast
32ace06a39 Templates: Fix the return value of get_the_author_posts_link().
When the `$authordata` global isn't defined, return an empty string, rather than `void`.

Props mukesh27, subrataemfluence.
Fixes #45597.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 05:54:49 +00:00
Gary Pendergast
4fa5437fc1 Admin: Use is_user_logged_in() instead of wp_validate_auth_cookie() in admin-post.php.
This matches the authentication check in `admin-ajax.php`, and allows the authentication method to be filtered.

Props jmdodd.
Fixes #45475.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 05:41:50 +00:00
Gary Pendergast
5ed802faf4 Docs: Correct the docs for POMO_Reader::setEndian().
The parameter type and name where the wrong way around.

Props ishitaka.
Fixes #45410.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 05:36:48 +00:00
Gary Pendergast
19642fd0c9 Docs: Correct the @return type of get_theme_mod().
This now matches the type of the `$value` parameter of `set_theme_mod()`.

Props mensmaximus.
Fixes #45319.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 05:32:48 +00:00
Gary Pendergast
97aef0e336 Docs: Remove duplicate docblocks for the pre_user_login and link_category filters.
Props coffee2code.
Fixes #45308.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 05:29:49 +00:00
Gary Pendergast
655d44ffe8 Users: Add extra checking to wp_new_user_notification().
Prevent a notification from being sent when an unrecognised value is passed in the `$notify` parameter.

Props cthreelabs, 360zen.
Fixes #44293.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 04:27:50 +00:00
Gary Pendergast
dd9442ae6c Posts: Set a HTTP 403 error when an incorrect post preview nonce is sent.
Props graymouser.
Fixes #43570.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 03:54:50 +00:00
Gary Pendergast
6f723ddf50 Docs: Add documentation for the wp_maybe_auto_update action.
Props MikeGillihan.
Fixes #43301.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 03:38:49 +00:00
Gary Pendergast
f2d2126d0d Admin Bar: Set the Admin Bar to not be showing on REST API requests.
Props ayeshrajans.
Fixes #45727.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 02:54:50 +00:00
desrosj
4bb472ac32 Docs: Add missing documentation for _WP_Dependency::set_translations().
Introduced in [43859].

Props stazdotio.
Fixes #45550.
Built from https://develop.svn.wordpress.org/trunk@44607


git-svn-id: http://core.svn.wordpress.org/trunk@44438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 22:48:51 +00:00
desrosj
50ddffbac3 Privacy: Use consistent variable naming when working with privacy requests.
Throughout the core privacy functions, `WP_User_Request` instances were stored in variables named both `$request`, and `$request_data`. This changes all occurrences of `$request_data` to `$request` for better consistency.

Props nateallen, bruceallen, garrett-eclipse.
Fixes #44708.
Built from https://develop.svn.wordpress.org/trunk@44606


git-svn-id: http://core.svn.wordpress.org/trunk@44437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 22:35:52 +00:00
Gary Pendergast
c062e39ac8 Docs: Tweak the docblock for setup_userdata().
This is a followup to [44603]. The default value should be last, not somewhere in the middle.

Props swissspidy.
Fixes #44697.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 10:29:50 +00:00
Andrea Fercia
f76f57e8ab Admin: Use the correct CSS media query for the Help tab on small screens after [44588].
See #43221

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


git-svn-id: http://core.svn.wordpress.org/trunk@44435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 07:48:50 +00:00
Gary Pendergast
e0c4e5b610 Users: Correct the default value in setup_userdata().
The `$for_user_id` parameter is an `int`, not a `string`, so the default value should be `0`, rather than an empty string.

Props subrataemfluence.
Fixes #44697.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 06:33:50 +00:00
Gary Pendergast
8ddef3e98d Users: Check that a valid user is passed to get_password_reset_key().
Props edocev.
Fixes #44601.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 06:27:49 +00:00
Gary Pendergast
a5d8a6bde3 Docs: Fix the WP_Object_Cache::get() docblock.
The `$force` parameter is a `bool`, not a `string`. The matching `wp_cache_get()` docblock has the correct type.

Props subrataemfluence.
Fixes #44454.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 06:18:51 +00:00
Gary Pendergast
656d8edcaf Docs: Add docblocks for WP_Customize_Header_Image_Control member variables.
Props subrataemfluence.
Fixes #44410.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 05:54:48 +00:00
Gary Pendergast
e4b25f1be2 Build Tools: Don't send AppVeyor notifications on Slack on repeated successful builds.
See #44276.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 05:49:49 +00:00
Gary Pendergast
883ee72ed6 Coding Standards: Move an assignment out of a condition in wp-admin/admin.php.
Props subrataemfluence, jrf, pento.
Fixes #44363.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 05:48:50 +00:00
Gary Pendergast
120710d8f8 Coding Standards: Move assignments out of conditions in wp-includes/user.php.
Props subrataemfluence.
See #44315.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 05:38:49 +00:00
Gary Pendergast
db696999f1 Updates: Tweak the "before updating, please back up..." message.
Props chetan200891, sebastien@thivinfo.com.
See #43790.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 05:20:50 +00:00
Gary Pendergast
4de7979b25 Build Tools: Tweak AppVeyor settings.
- Set `grunt build` as the build script
- Disable testing and deployment options
- Customise the Slack integration message
- Only show the Slack message when the status changes

See #44276.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 04:51:52 +00:00
Gary Pendergast
c009a1960a Build Tools: Add AppVeyor integration.
AppVeyor allows us to test in a Windows environment. This first iteration tests that building works correctly.

Props netweb.
Fixes #44276.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 04:21:50 +00:00
desrosj
59fbee8544 Coding Standards: Assignments must be the first block of code on a line.
Props subrataemfluence.
Fixes #44225.
Built from https://develop.svn.wordpress.org/trunk@44593


git-svn-id: http://core.svn.wordpress.org/trunk@44424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 02:41:50 +00:00
desrosj
34c4ce3c81 Docs: Update inaccurate return descriptions.
In the `@return` tag description for `get_post_modified_time()`, `get_the_time()`, and `get_post_time()`, the `$d` parameter is incorrectly referred to as `$id`.

Props behzod.
Fixes #45323.
Built from https://develop.svn.wordpress.org/trunk@44592


git-svn-id: http://core.svn.wordpress.org/trunk@44423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 02:08:49 +00:00
Gary Pendergast
bf43978730 Link Template: In get_adjacent_post(), move the sanitisation of $excluded_terms earlier.
This is a followup to [42828], ensuring that the `get_{$adjacent}_post_excluded_terms` filter is always passed an array, as expected.

Props soulseekah, zottto.
Fixes #43521.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 01:54:49 +00:00
Gary Pendergast
6073c6e209 Docs: Update the @since version for the doing_it_wrong_trigger_error filter.
Fixes #34183.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 00:52:50 +00:00
Gary Pendergast
2f288c306c Widgets: Remove unnecessary sanitize_text_field() calls in core widget ::form() methods.
This sanitisation only needs to be run in `::update()` to correctly clean up the input.

Props welcher, greenshady.
Fixes #42461.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 00:43:49 +00:00
Gary Pendergast
11e9c98d5b Admin: Make the Help tab available on small screens.
Props jobthomas, xkon.
Fixes #43221.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 00:20:50 +00:00
Gary Pendergast
d2695fe283 Query: Cache the result when get_pages() doesn't find anything in the database.
Props flixos90, soulseekah.
Fixes #43514.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 23:27:50 +00:00
Gary Pendergast
56e77d8928 Docs: Improve the docblock of wp_admin_bar_edit_menu().
What age were you when you learned that there's a `$user_id` global, as well as `$user_ID` global? I was today years old.

Props pento, mukesh27.
Fixes #43448.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 23:12:50 +00:00
Gary Pendergast
767fb99e94 Docs: Improve documentation of the `$wp_registered_sidebars global.
Props mukesh27.
Fixes #43448.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 23:01:49 +00:00
desrosj
a7d0293446 Tests: Add missing parent::tearDown().
Also, remove a `tearDown()` method that was not serving any purpose.

Fixes #45931.
Built from https://develop.svn.wordpress.org/trunk@44584


git-svn-id: http://core.svn.wordpress.org/trunk@44415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 21:34:55 +00:00
Gary Pendergast
51f4314441 Customizer: Use the sandbox attribute to prevent top navigation from the preview.
Props valchovski.
Fixes #42341.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 07:25:50 +00:00
Gary Pendergast
b083cc65aa Customizer: Fix a coding standards issue introduced in [44580].
See #40020.



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


git-svn-id: http://core.svn.wordpress.org/trunk@44413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 07:23:50 +00:00
Gary Pendergast
0390ddad6b Docs: Improve docblocks for _get_plugin_data_markup_translate() and _sort_uname_callback().
Props Jaydeep Rami.
Fixes #42228.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 06:54:49 +00:00
Gary Pendergast
d8f4a04232 Customizer: Improve browser compatibility of the preview iframe.
When `home` and `siteurl` are different, the customizer preview iframe will be blank in Chrome and Safari, due to their `X-Frame-Options` implementation quirks.

Changing this to `SAMEORIGIN` and adding the `frame-ancestors` Content Security Policy gives the correct behaviour.

Props fullyint.
Fixes #40020.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 06:38:51 +00:00
Gary Pendergast
10c66fb426 Formatting: Remove soft hyphens when sanitising titles.
Props andg.
Fixes #45378.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 05:39:51 +00:00
Gary Pendergast
fcd66d09d9 Widgets: Don't log invalid HTML in the Text Widget.
[41215] supresses these irrelevant error messages from the front end, this removes them from the error log, too.

Props jeherve.
Fixes #43815.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 05:05:48 +00:00
Gary Pendergast
5ed789dc63 Tests: Add missing parent::setUp() calls to all test classes.
Props johnbillion, birgire.
Fixes #37375.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 04:54:50 +00:00
Gary Pendergast
0bbfe3b8e2 Blocks: Add a $source_block parameter to the render_block_data filter.
This contains a copy of the block, unmodified by other filter functions, so that plugins have a clean reference to work from, if they need.

Props dmsnell.
Fixes #45451.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 01:47:51 +00:00
Andrea Fercia
1c59f76953 Accessibility: Exclude the Windows High Contrast mode transparent outline from the CSS transition after [44544].
See #41286.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 15:01:49 +00:00
Gary Pendergast
7a617078fa Coding Standards: Upgrade WPCS to 1.2.1.
This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues.

Fixes #45956.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 06:41:52 +00:00
Gary Pendergast
8656a65e1e Coding Standards: Fix and whitelist variable names.
From the `WordPress.NamingConventions.ValidVariableName` sniff, this commit fixes/whitelists all `NotSnakeCaseMemberVar`, `MemberNotSnakeCase`, and `StringNotSnakeCase` violations. It also fixes a handful of the `NotSnakeCase` violations.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 06:06:48 +00:00
Gary Pendergast
3a697f7f46 Coding Standards: Remove an unnecessary line whitelisting.
Props jrf.
See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 04:53:51 +00:00
Gary Pendergast
f72594974f Coding Standards: Exclude some external files.
- `class-wp-block-parser.php` and `wp-includes/blocks/*` are imported from the Gutenberg plugin.
- `speed-trap-listener.php` is a third party library.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 04:01:50 +00:00
Gary Pendergast
57fcb7d8dd Coding Standards: Fix an incorrect phpcs:ignore comment.
It's `phpcs:ignore`, not `wpcs:ignore`.

Props GaryJ.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 03:49:49 +00:00
Gary Pendergast
08e8270a48 Coding Standards: Extract extract() from the codebase.
Of the last four instances of `extract()` occurring, three of them are removed by this commit, and the fourth is appropriately documented.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-12 03:20:48 +00:00
desrosj
2785313bf2 REST API: Encourage proper usage of register_rest_route().
Calling `register_rest_route()` too early in the loading process has the potential to cause some unintentional problems and pitfalls. Because `register_rest_route()` calls `rest_get_server()` (which creates the `WP_REST_Server` instance), calling the function directly and/or before `rest_api_init` should be discouraged.

For example, if `register_rest_route ()` is called on `init`, the REST API server instance is set up (and all functions added to `rest_api_init` and other related hooks are invoked), even though the current request may not be a REST request. Also, if `register_rest_route()` is called even earlier (say, in an `mu-plugin` file), required endpoints may be missing since normal plugins have not yet been loaded and have not had a chance to register their own action hooks.

This adds a `_doing_it_wrong()` notice the first time `register_rest_route()` is called before `rest_api_init` in a request to encourage best practices for registering REST API routes.

Props kraftbj, desrosj, timothyblynjacobs.
Fixes #45265.
Built from https://develop.svn.wordpress.org/trunk@44568


git-svn-id: http://core.svn.wordpress.org/trunk@44399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 18:19:49 +00:00
Andrea Fercia
298ef1992e Menus: Make menu items not jump while dragging items.
Props alexvorn2, welcher, afercia.
Fixes #41160.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 13:56:49 +00:00
Gary Pendergast
4f861b9548 Coding Standards: Fix the Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace violations.
See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:40:50 +00:00
Gary Pendergast
6d5cd6842a Coding Standards: Document intentional case block fall-throughs.
Fixes `PSR2.ControlStructures.SwitchDeclaration.TerminatingComment` violations.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:26:50 +00:00
Gary Pendergast
c00229969a Coding Standards: Add exceptions for WordPress.Files.FileName.NotHyphenatedLowercase.
See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:17:50 +00:00
Gary Pendergast
3cbd512161 Coding Standards: Ignore the violations of Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase.
See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:08:50 +00:00
Gary Pendergast
c008959e9e Coding Standards: Fix the minor WordPress.WP.I18n violations.
`WordPress.WP.I18n.MissingTranslatorsComment` is in progress in #44360.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:04:49 +00:00
Gary Pendergast
e05b19d248 Coding Standards: template.php isn't a template tag file.
`WordPress.Files.FileName.InvalidTemplateTagFileName` shouldn't apply to it.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 05:00:50 +00:00
Gary Pendergast
9e87cb7fa2 Coding Standards: Ignore the single WordPress.PHP.RestrictedPHPFunctions.create_function_create_function violation.
This is intentional, for older PHP support.

See #45934.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 03:45:48 +00:00
Gary Pendergast
5afa0c9ee3 Coding Standards: Remove PHPCS 2.x @codingStandardsIgnore* ignore syntax.
Props netweb.
Fixes #42808.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 03:04:51 +00:00
Gary Pendergast
3c0c01f348 Post WordPress 5.1 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@44558


git-svn-id: http://core.svn.wordpress.org/trunk@44389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 00:59:50 +00:00
Gary Pendergast
e11b64ddba WordPress 5.1 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@44557


git-svn-id: http://core.svn.wordpress.org/trunk@44388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 00:42:48 +00:00
Gary Pendergast
8e623691c0 Emoji: Fix a code formatting error introduced in [44554].
See #45930.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 23:40:49 +00:00
Gary Pendergast
203d686ec9 Blocks: Reverse the logic when checking the pre_render_block result.
We should be returning if the result isn't null, not when it is.

See #45451.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 23:31:50 +00:00
Gary Pendergast
92146fe52b Emoji: Improve performance when encoding or staticizing emoji.
Both `wp_encode_emoji()` and `wp_staticize_emoji()` perform a PHP version check when deciding how to apply their behaviour, but this check only needs to happen once, rather than every time in their internal looks.

Moving the check outside of the loop reduces processing time by 50%.

Props johnbillion.
Fixes #45930.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 23:20:52 +00:00
Gary Pendergast
8e2f6a9923 Blocks: Add the pre_render_block and render_block_data filters.
At the start of `render_block()`, the `pre_render_block` filter allows the function to be short-circuited, and the `render_block_data` filter is applied to the `$block` parameter before it's processed.

Props kkarpieszuk, pento.
Fixes #45451.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 23:16:50 +00:00
desrosj
b98affb210 Embeds: Remove Photobucket, FunnyOrDie from the list of oEmbed providers.
These services no longer support oEmbed.

Props skostadinov, notnownikki.
Fixes #45399.
Built from https://develop.svn.wordpress.org/trunk@44552


git-svn-id: http://core.svn.wordpress.org/trunk@44383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 22:42:51 +00:00
Andrea Fercia
9a9b5699fd Accessibility: Improve text input in the Tags meta box when using Safari + Voiceover.
Props parbaugh, konainm, wbrubaker, pento, ryelle.
Fixes #44966.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 22:30:49 +00:00
desrosj
d11928bc65 Docs: Add missing periods to param annotations for flip() in WP_Image_Editor_GD.
Props hitendra-chopda.
Fixes #45208.
Built from https://develop.svn.wordpress.org/trunk@44550


git-svn-id: http://core.svn.wordpress.org/trunk@44381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 22:10:50 +00:00
Andrea Fercia
64bbbda39e Accessibility: Improve color contrast ratio in the Events and News dashboard widget.
Props boemedia, lucagrandicelli.
Fixes #45280.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 22:08:49 +00:00
desrosj
3dcc536b80 Media: Correct since annotation for adding the caption_id attribute.
Introduced in [42704]
Fixes #34595.
Built from https://develop.svn.wordpress.org/trunk@44548


git-svn-id: http://core.svn.wordpress.org/trunk@44379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 21:37:49 +00:00
Felix Arntz
be54938eef General: Fix existing coding standard violations in bookmark tests, as outlined in [44546].
See #43977.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 21:17:51 +00:00
Felix Arntz
a71d208785 General: Fix problematic string to array parsing.
WordPress has historically often used code like `preg_split( '/[\s,]+/', $var )` to parse a string of comma-separated values into an array. However, this approach was causing an empty string to not be parsed into an empty array as expected, but rather into an array with the empty string as its sole element.

This was among other areas causing problems in the REST API where passing an empty request parameter could cause that request to fail because, instead of it being ignored, that parameter would be compared against the valid values for it, which typically do not include an empty string.

Props david.binda, sstoqnov.
Fixes #43977.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 21:06:49 +00:00
Andrea Fercia
0b5beabd36 Accessibility: Remove negative tabindex from the login, install, and setup pages header.
Props bamadesigner, rishishah, jainnidhi.
Fixes #42632.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 17:21:52 +00:00
Andrea Fercia
7481337591 Accessibility: Add focus styles for Windows High Contrast mode.
Introduces in core new focus styles dedicated to Windows High Contrast mode. The 
new styles use a transparent CSS outline as already explored in the Block Editor.
This first part covers some of the main user interface controls like buttons, links,
and media views elements. Other parts will be addressed in the next future.

Fixes #41286.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 16:47:50 +00:00
Andrea Fercia
c40ae024cd Accessibility: Improve the way Safari and VoiceOver read out the screen reader text.
Sometimes, Safari and VoiceOver read out the text hidden with `screen-reader-text`
in a wrong order. While there's no known, full, solution, it is possible to make 
them respect the correct order reliably at least within buttons.

Fixes #42006.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 16:31:49 +00:00
desrosj
ae5c195d57 Media: Introduce the has_post_thumbnail filter.
Props rzen, desrosj.
Fixes #44859.
Built from https://develop.svn.wordpress.org/trunk@44542


git-svn-id: http://core.svn.wordpress.org/trunk@44373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 15:28:50 +00:00
Felix Arntz
f251342de7 I18n: Add missing translator comments in wp-admin/includes/class-wp-plugins-list-table.php.
Fixes #45898.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 10:46:53 +00:00
desrosj
ca36ed433b Docs: Correct since annotation for _wp_get_allowed_postdata().
This function was introduced in 5.0.1, not 4.9.9 as currently indicated. Introduced in [44047].
Built from https://develop.svn.wordpress.org/trunk@44540


git-svn-id: http://core.svn.wordpress.org/trunk@44371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 03:31:49 +00:00
Gary Pendergast
2772e5ec06 Admin: Don't use the keyup event in addition to the input event.
The `keyup` event was used to provide support for IE8, where which doesn't support the `input` event. As we dropped IE8 support some time ago, this was simply adding unnecessary complexity and double-event triggers.

Props dlh, afercia.
Fixes #32882.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:57:50 +00:00
desrosj
8eb90ac374 Docs: Restore output annotation in tags-suggest.js.
This was mistakenly removed in [44537].

See #38922.
Built from https://develop.svn.wordpress.org/trunk@44538


git-svn-id: http://core.svn.wordpress.org/trunk@44369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:50:51 +00:00
desrosj
6fbf4ceaea REST API: Restore use of wp_ajax_ajax_tag_search() for tag search.
This solution does not work with custom taxonomies in the current state.

Reverts [42614,42619,42737].

Props danielbachhuber.
See #38922.
Built from https://develop.svn.wordpress.org/trunk@44537


git-svn-id: http://core.svn.wordpress.org/trunk@44368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:37:51 +00:00
Gary Pendergast
8441700842 Tests: Add support for a WP_TESTS_SKIP_INSTALL environment variable.
Defining `WP_TESTS_SKIP_INSTALL=1` when running tests will skip the install step. While this shouldn't be used for full test runs, it's useful for saving time when running small groups of tests.

Props soulseekah.
Fixes #43432.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:19:50 +00:00
desrosj
7855451267 Privacy: Add unit tests for privacy erasure fulfillment notifications.
Adds appropriate unit tests for `_wp_privacy_send_erasure_fulfillment_notification()`.

Props birgire, desrosj.
Fixes #44234.
Built from https://develop.svn.wordpress.org/trunk@44535


git-svn-id: http://core.svn.wordpress.org/trunk@44366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:07:49 +00:00
Gary Pendergast
c219081ce7 Build/Tests: Allow running unit tests from src.
This is a partial recommit of [44509]: it allows running unit tests from `src` (which is useful), but doesn't make it the default (which Travis is having issues with).

See #45863.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 02:04:50 +00:00
Gary Pendergast
14c44ad703 Block Editor: Upgrade the @wordpress/ packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.

Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 01:54:56 +00:00
desrosj
da77cad30f PHPCS: Fix formatting issues.
Fixes formatting issues introduced in [44528].

See #42017.
Built from https://develop.svn.wordpress.org/trunk@44532


git-svn-id: http://core.svn.wordpress.org/trunk@44363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 01:52:52 +00:00
desrosj
72098048c6 Docs: Update since annotation for text-transform support in safecss_filter_attr().
Introduced in [42880].

Fixes #42729.
Built from https://develop.svn.wordpress.org/trunk@44531


git-svn-id: http://core.svn.wordpress.org/trunk@44362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 01:43:49 +00:00
desrosj
d83d8e1154 Docs: Update since annotation for comments_list_table_query_args.
Introduced in [42420].

Fixes #42997.
Built from https://develop.svn.wordpress.org/trunk@44530


git-svn-id: http://core.svn.wordpress.org/trunk@44361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 01:40:51 +00:00
Gary Pendergast
e69c1039eb Build Tools: Copy unminified JS files to src.
This allows `SCRIPT_DEBUG` to be set to `true` when running from `src`.

Fixes #45869.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 01:39:50 +00:00
desrosj
13c66b1b18 Media: Store audio creation date in meta.
In [41746], `wp_get_media_creation_timestamp()` was introduced to read the created timestamp for videos from `getID3` in meta whenever possible. This information is useful separately from the dates on the file itself.

This adds the same support audio files by utilizing `wp_get_media_creation_timestamp()` in `wp_read_audio_metadata()`.

Props blob folio, desrosj.
Fixes #42017.
Built from https://develop.svn.wordpress.org/trunk@44528


git-svn-id: http://core.svn.wordpress.org/trunk@44359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 01:32:50 +00:00
desrosj
cf1e3b0c40 Docs: Update since annotations WP_Error::has_errors()
Introduced in [42761].

Fixes #42742.
Built from https://develop.svn.wordpress.org/trunk@44527


git-svn-id: http://core.svn.wordpress.org/trunk@44358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 22:42:51 +00:00
Felix Arntz
5bb4a5aa0e Upgrade/Install: Add missing call to clear site meta cache in populate_site_meta().
See #44896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 21:29:50 +00:00
Felix Arntz
83603991c6 Bootstrap/Load: Fix missing object argument for singular capability checks and support capability tests overlooked in [44524].
See #44458.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:44:50 +00:00