Commit Graph

27433 Commits

Author SHA1 Message Date
Aaron Jorbin dd3ad3ac51 GENERAL: Remove magic quote functions
The path to magic quote sanity took a fun and exciting turn: PHP core removed it and WordPress updated the minimum version.

For the formally external pclzip, the code is commented out to make investigating easier and in case we ever need to merge upstream (if that still exists) changes.

Props ayeshrajans, jrf, jorbin.
See #47783.
Fixes #18322.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 22:21:01 +00:00
desrosj 8a2bbf777a Correct the version number specified in [46102].
See #45361.
Built from https://develop.svn.wordpress.org/trunk@46104


git-svn-id: http://core.svn.wordpress.org/trunk@45916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 18:55:56 +00:00
Adam Silverstein a3eba2c201 Login and Registration: reset password - ensure submit button disabled when field empty.
Fix an issue where the submit button was enabled with an empty password when the user previously checked "Confirm use of weak password" for a weak password, then cleared the password field.

Props henry.wright.
Fixes #47924.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 18:30:55 +00:00
desrosj 7bbce99655 Menus: Nav menu locations should not be integers.
When nav menu location slugs are integers, some hard to debug results can occur. `register_nav_menus()` utilizes `array_merge()` which renumbers numeric indexes, starting from 0. Because of this, numeric menu locations will almost always be changed.

This change introduces a `_doing_it_wrong()` notice to inform developers that nav menu locations should always be strings.

Props audrasjb, desrosj, welcher.
Fixes #45361.
Built from https://develop.svn.wordpress.org/trunk@46102


git-svn-id: http://core.svn.wordpress.org/trunk@45914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 17:58:55 +00:00
Sergey Biryukov 55378bd295 REST API: Use correct parameter name in `rest_validate_value_from_schema()` error messages.
Props manzoorwanijk.
Fixes #47905.
Built from https://develop.svn.wordpress.org/trunk@46101


git-svn-id: http://core.svn.wordpress.org/trunk@45913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 03:06:55 +00:00
Adam Silverstein 67fd6e281f Multisite: improve `sites_pre_query` and `networks_pre_query` filters, avoiding db queries.
Improve the `pre_query` filters in multisite classes introduced in r44983. Return (non null) values immediately,
avoiding the database queries entirely, similar to other `pre_query` filters.

Props spacedmonkey, SergeyBiryukov, felipeelia.
Fixes #47599.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 22:17:55 +00:00
K. Adam White c148f0aa55 REST API: Accept string path in rest_ensure_request.
Update `rest_ensure_request()` to accept a string path, permitting a string path to be passed to `rest_do_request()` as is indicated (previously inaccurately) in that method's PHPDoc.

Props TimothyBlynJacobs, kadamwhite.
Fixes #40614.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 21:47:57 +00:00
K. Adam White 742ab2d68b REST API: Return term resources in "edit" context after PUT or POST request.
Props westonruter, dlh.
Fixes #41411.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 21:29:57 +00:00
Sergey Biryukov b987372d75 Mail: Update PHPMailer to 5.2.27.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.22...PHPMailer:v5.2.27

Props MattyRob, ayeshrajans, rogueresearch, bgermann, slaFFik, Presskopp, aaroncampbell.
Fixes #40472.
Built from https://develop.svn.wordpress.org/trunk@46097


git-svn-id: http://core.svn.wordpress.org/trunk@45909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 14:37:57 +00:00
Sergey Biryukov 3591f1ad60 Text Changes: Correct "up-to-date" vs. "up to date" usage in a database update string and inline comments.
* "Up to date" is an adverb phrase that describes an action that brings something in line with the latest information.
* "Up-to-date" is an adjective phrase that is used as a synonym for "current".

Props socalchristina, hareesh-pillai, garrett-eclipse, desrosj, aprea.
Fixes #38998.
Built from https://develop.svn.wordpress.org/trunk@46096


git-svn-id: http://core.svn.wordpress.org/trunk@45908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 13:06:57 +00:00
Sergey Biryukov cc6e23e4dc External Libraries: Update jQuery Color plugin to 2.1.2.
Props desrosj, hareesh-pillai, lovememore.
Fixes #31511.
Built from https://develop.svn.wordpress.org/trunk@46095


git-svn-id: http://core.svn.wordpress.org/trunk@45907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 12:41:54 +00:00
Sergey Biryukov b552f449db HTTP: Update the Root Certificate bundle.
Keep 1024-bit legacy root certificates re-added in [35919], except for those already expired, for compatibility with older OpenSSL versions.

Props skithund, paragoninitiativeenterprises.
Fixes #45807.
Built from https://develop.svn.wordpress.org/trunk@46094


git-svn-id: http://core.svn.wordpress.org/trunk@45906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 12:04:59 +00:00
Sergey Biryukov 877f356334 External Libraries: Revert [46092] pending test failure investigation.
See #45785.
Built from https://develop.svn.wordpress.org/trunk@46093


git-svn-id: http://core.svn.wordpress.org/trunk@45905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 10:19:59 +00:00
desrosj f7f27c37aa External Libraries: Update Underscore to 1.9.1.
Changes: https://github.com/jashkenas/underscore/compare/1.8.3...1.9.1

Props mukesh27, hareesh-pillai.
Fixes #45785
Built from https://develop.svn.wordpress.org/trunk@46092


git-svn-id: http://core.svn.wordpress.org/trunk@45904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-11 19:22:54 +00:00
desrosj abed60bb51 Editor: Add missing block data fields for blocks registered server side.
In [44122], the `styles` and `parent` block fields were omitted on accident. This change makes it possible to reuse them on the client.

Props gziolo.
Fixes #47017.
Built from https://develop.svn.wordpress.org/trunk@46091


git-svn-id: http://core.svn.wordpress.org/trunk@45903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-11 14:52:56 +00:00
Sergey Biryukov 5289afac9b Accessibility: Comments: In `comment_form()`, remove `aria-describedby` attribute from the email field if there's no associated description in the `comment_notes_before` argument.
The attribute is meant to communicate to user agents and assistive technologies that the element has a description. If the referenced description is missing, it will be flagged as failure by any automated accessibility checker tool and, most importantly, is potentially confusing for assistive technologies users.

Props afercia, joedolson, dinhtungdu, donmhico, SergeyBiryukov.
Fixes #47975.
Built from https://develop.svn.wordpress.org/trunk@46090


git-svn-id: http://core.svn.wordpress.org/trunk@45902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-11 01:51:54 +00:00
Sergey Biryukov 4d1761c881 Coding Standards: Fix WPCS issue in [46088].
See #47110.
Built from https://develop.svn.wordpress.org/trunk@46089


git-svn-id: http://core.svn.wordpress.org/trunk@45901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-10 20:01:54 +00:00
Sergey Biryukov dcb08f0637 Docs: Fix placement of some duplicate hook references.
Hook documentation should be on the line directly above the line containing the `do_action()` or `apply_filters()` call. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of duplicate hook references.

Includes minor code layout fixes.

See #47110.
Built from https://develop.svn.wordpress.org/trunk@46088


git-svn-id: http://core.svn.wordpress.org/trunk@45900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-10 19:23:55 +00:00
Sergey Biryukov c9071ca2e6 Docs: Clarify the `int` return value in `comments_pre_query` filter DocBlock.
See #45800.
Built from https://develop.svn.wordpress.org/trunk@46087


git-svn-id: http://core.svn.wordpress.org/trunk@45899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-10 19:04:56 +00:00
Adam Silverstein b3e64f0947 Comments: add a new `comments_pre_query` filter to short circuit WP_Comment_Query 'get_comments' queries.
Return a non-null value to bypass WordPress's default comment queries.

Props felipeelia, spacedmonkey.
Fixes #45800.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-10 18:42:56 +00:00
Sergey Biryukov 49b4cfc034 Accessibility: Media: Replace `@` with `at` in the displayed date format.
The `@` symbol makes sense in the context of email addresses, but does not have a universal meaning in the context of dates.

Props audrasjb, afercia.
Fixes #47893.
Built from https://develop.svn.wordpress.org/trunk@46085


git-svn-id: http://core.svn.wordpress.org/trunk@45897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-09 00:07:57 +00:00
Sergey Biryukov 86a10090a0 Accessibility: Comments: Replace `@` with `at` in the displayed date format.
The `@` symbol makes sense in the context of email addresses, but does not have a universal meaning in the context of dates.

Props birgire, afercia, audrasjb, SergeyBiryukov.
Fixes #47893.
Built from https://develop.svn.wordpress.org/trunk@46084


git-svn-id: http://core.svn.wordpress.org/trunk@45896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-08 23:53:55 +00:00
Sergey Biryukov f8ba775d7c Accessibility: Posts, Post Types: Replace `@` with `at` in the displayed date format.
The `@` symbol makes sense in the context of email addresses, but does not have a universal meaning in the context of dates.

Props birgire, afercia, audrasjb, SergeyBiryukov.
Fixes #47832.
Built from https://develop.svn.wordpress.org/trunk@46083


git-svn-id: http://core.svn.wordpress.org/trunk@45895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-08 23:24:56 +00:00
Sergey Biryukov 0393a78206 Docs: Fix typo in `WP_Hook::resort_active_iterations()` description.
Props itowhid06.
Fixes #47999.
Built from https://develop.svn.wordpress.org/trunk@46082


git-svn-id: http://core.svn.wordpress.org/trunk@45894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-08 13:16:55 +00:00
Andrew Ozz c0b5127683 Upload: Reset the temp upload reference in Plupload when the file is not an image.
See #47872.
Built from https://develop.svn.wordpress.org/trunk@46081


git-svn-id: http://core.svn.wordpress.org/trunk@45893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-08 02:28:55 +00:00
Sergey Biryukov e26f739e53 Posts, Post Types: Revert [46079] pending test failure investigation.
See #47824.
Built from https://develop.svn.wordpress.org/trunk@46080


git-svn-id: http://core.svn.wordpress.org/trunk@45892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-07 19:33:55 +00:00
Sergey Biryukov 7828fe7e6a Posts, Post Types: Avoid a PHP warning when `the_content()` is called outside of the loop.
Fixes #47824.
Built from https://develop.svn.wordpress.org/trunk@46079


git-svn-id: http://core.svn.wordpress.org/trunk@45891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-07 14:33:56 +00:00
Andrew Ozz 2d6a772400 Fix "white spaces at end of line" in docblock (IDE) woes after [46077].
See #32437.
Built from https://develop.svn.wordpress.org/trunk@46078


git-svn-id: http://core.svn.wordpress.org/trunk@45890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-07 02:12:55 +00:00
Andrew Ozz 1de168e016 Media: Improve handling of cases where an uploaded image matches exactly a defined intermediate size. In most of these cases the original image has been edited by the user and is "web ready", there is no need for an identical intermediate image.
Introduces the `wp_image_resize_identical_dimensions` filter so plugins and themes can determine whether a new image with identical dimensions should be created, defaults to false.

Props wpdennis, HKandulla, galbaras, azaozz.
See #32437.
Built from https://develop.svn.wordpress.org/trunk@46077


git-svn-id: http://core.svn.wordpress.org/trunk@45889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-07 01:34:55 +00:00
Andrew Ozz dc8349ba0a Media: Add handling for "BIG" images. When the users upload a big image, typically a photo, scale it down to make it suitable for web use. Then use the scaled image as the "full" size, and keep the originally uploaded image for creating high quality sub-sizes in the future and in case the users want to download it later.
Introduces `wp_get_original_image_path()` that retrieves the path to the originally uploaded image in all cases, and `big_image_size_threshold` filter to set the pixel value above which images will be scaled. The same value is used as max-width and max-height when scaling.

See #47873.
Built from https://develop.svn.wordpress.org/trunk@46076


git-svn-id: http://core.svn.wordpress.org/trunk@45888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-07 01:07:55 +00:00
Andrew Ozz 630bad3a4f Uploads: Improve the error message shown when all attempts to create image sub-sizes fail.
Props afercia.
See #47872.
Built from https://develop.svn.wordpress.org/trunk@46075


git-svn-id: http://core.svn.wordpress.org/trunk@45887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-06 23:48:55 +00:00
whyisjake f4562e5516 Remove the extra call for wp-sanitize from the script loader.
Fixes #47986

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


git-svn-id: http://core.svn.wordpress.org/trunk@45885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-06 21:49:59 +00:00
Sergey Biryukov 699c6001fd Upgrade/Install: Escape the `%` in `width="100%"` in a `printf()` call in `Plugin_Upgrader_Skin::after()`.
Props afragen.
Fixes #47989.
Built from https://develop.svn.wordpress.org/trunk@46072


git-svn-id: http://core.svn.wordpress.org/trunk@45884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-06 06:26:56 +00:00
Sergey Biryukov c1e3b68b19 Docs: Improve documentation for `do_meta_boxes` action.
Props felipeelia, killua99, SergeyBiryukov.
Fixes #46542.
Built from https://develop.svn.wordpress.org/trunk@46071


git-svn-id: http://core.svn.wordpress.org/trunk@45883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-06 00:06:56 +00:00
Sergey Biryukov 6cab9557fb REST API: Mark `WP_REST_Users_Controller::update_current_item()` and `::delete_current_item()` as public.
Props dkarfa.
Fixes #47967.
Built from https://develop.svn.wordpress.org/trunk@46070


git-svn-id: http://core.svn.wordpress.org/trunk@45882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-05 23:18:55 +00:00
Sergey Biryukov 65747e3c91 Docs: Remove extra spaces in various REST API DocBlocks.
See #47110.
Built from https://develop.svn.wordpress.org/trunk@46069


git-svn-id: http://core.svn.wordpress.org/trunk@45881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-05 23:05:55 +00:00
Sergey Biryukov 7fb9cba55a Docs: Correct DocBlocks for `WP_REST_Posts_Controller::get_available_actions()` and `WP_REST_Revisions_Controller::get_parent()`.
Props dkarfa.
Fixes #47966.
Built from https://develop.svn.wordpress.org/trunk@46068


git-svn-id: http://core.svn.wordpress.org/trunk@45880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-05 22:59:54 +00:00
Andrew Ozz ee005d8fc5 Fix (unrelated) test after [46066].
See #43524.
Built from https://develop.svn.wordpress.org/trunk@46067


git-svn-id: http://core.svn.wordpress.org/trunk@45879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-05 22:53:56 +00:00
Andrew Ozz 3b976836a8 Media: Add two new intermediate image sizes, 1536px and 2048px. They are meant to enhance the way WordPress displays images on the front-end on larger, high-density devices. They make it possible to generate more suitable `srcset` and `sizes` attributes, and not use the original, often non-optimized image.
Also change the default `max_srcset_image_width` value to match the new max size.

Props pierlo, azaozz.
See #43524.
Built from https://develop.svn.wordpress.org/trunk@46066


git-svn-id: http://core.svn.wordpress.org/trunk@45878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-05 22:27:58 +00:00
Andrea Fercia 8fe3c3fa23 Widgets: Fix "jumpiness" when reordering widgets by dragging them.
Props ketanumretiya030, mukesh27, andraganescu, audrasjb.
Fixes #46941.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 21:49:59 +00:00
Andrea Fercia 17652fb3d4 Widgets: Fix "jumpiness" when reordering widgets by dragging them.
Props ketanumretiya030, mukesh27, andraganescu, audrasjb.
Fixes #46941.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 21:49:48 +00:00
Sergey Biryukov b9d4003d26 Coding Standards: Fix WPCS issue in [45990].
Built from https://develop.svn.wordpress.org/trunk@46019


git-svn-id: http://core.svn.wordpress.org/trunk@45830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 21:45:07 +00:00
desrosj 30ac675795 Fix for URL sanitization that can lead to cross-site scripting (XSS) attacks.
Props irsdl, sstoqnov, whyisjake.
Built from https://develop.svn.wordpress.org/trunk@45997


git-svn-id: http://core.svn.wordpress.org/trunk@45808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 17:52:56 +00:00
Sergey Biryukov 62b22b86a7 Improve handling the existing `rel` attribute in `wp_rel_nofollow_callback()`.
Props xknown, sstoqnov.
Built from https://develop.svn.wordpress.org/trunk@45990


git-svn-id: http://core.svn.wordpress.org/trunk@45801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 17:37:55 +00:00
whyisjake 90d9bdc54c Update wp.a11y.speak() to sanitize HTML before display.
Props iandunn, adamsilverstein, sstoqnov, peterwilsoncc

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


git-svn-id: http://core.svn.wordpress.org/trunk@45790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 17:13:21 +00:00
Sergey Biryukov c86ee39ff4 Improve URL validation in `wp_validate_redirect()`.
Props vortfu, whyisjake, peterwilsoncc.
Built from https://develop.svn.wordpress.org/trunk@45971


git-svn-id: http://core.svn.wordpress.org/trunk@45782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 16:57:56 +00:00
Andrea Fercia 187d747198 Bundled Theme: Twenty Nineteen: Use human-friendly color names.
For better accessibility, the Primary and Secondary theme colors have now more understandable names.
Changes the names "Primary" and "Secondary" to "Blue" and "Dark Blue". Fallbacks to the `hex` color codes when the theme is set to use a custom Primary color.

Props kjellr, aduth, audrasjb.
Fixes #46698.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 16:47:10 +00:00
Andrea Fercia 8cb7918905 Bundled Theme: Twenty Nineteen: Fix the nesting of the `main` element.
The `main` element must not appear as a descendant of the `section` element. Correct markup is the first requirement to make user agents and assistive technologies work properly.

Changes the `<section>` element that was wrapping the `<main>` element to a `<div>`.

Props albertomake, ryelle, desrosj, ianbelanger, audrasjb.
Fixes #47066.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 16:27:54 +00:00
Sergey Biryukov 761cd81a01 Escape the output in `wp_ajax_upload_attachment()`.
Props whyisjake, sstoqnov.
Built from https://develop.svn.wordpress.org/trunk@45936


git-svn-id: http://core.svn.wordpress.org/trunk@45747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 16:09:56 +00:00
whyisjake 50d33282c1 Remove _convert_urlencoded_to_entities() from the get_the_content() callback.
Props vortfu, whyisjake, peterwilsoncc

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


git-svn-id: http://core.svn.wordpress.org/trunk@45746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 16:04:56 +00:00
Andrew Ozz e313498193 Uploads: After an image is uploaded and PHP times out or runs out of memory during post-processing (the server response is HTTP 500 error), try to resize it three more times. Then, if all attempts fail, do a cleanup of any sub-sizes that may have been created and show an error message asking the user to scale the image and upload it again.
See #47872.
Built from https://develop.svn.wordpress.org/trunk@45934


git-svn-id: http://core.svn.wordpress.org/trunk@45745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 01:11:54 +00:00
Sergey Biryukov 97cbf72bf9 I18N: Fix typo in a function name in [45932].
See #44360.
Built from https://develop.svn.wordpress.org/trunk@45933


git-svn-id: http://core.svn.wordpress.org/trunk@45744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:57:54 +00:00
Sergey Biryukov e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Andrea Fercia 216838a0d2 Accessibility: Improve focus styles for legacy modal dialogs powered by jQuery UI.
Fixes #47944.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-02 21:49:55 +00:00
Andrea Fercia fbc9dba70b Accessibility: Audit usage of abbreviations.
Title attributes on abbreviations are only available to a minority of users. The
best option is to avoid unnecessary abbreviations when possible. In the other cases,
use an `<abbr>` element (which provides a hint to user agents on how to announce
and display the abbreviation) and provide an expansion in plain text on first use.

- `readme.html`: improves abbreviations and removes unnecessary `title` attributes
- options-general: removes unnecessary abbreviations and improves the remaining ones
- customizer schedule changeset date: removes unnecessary abbreviations and improves the remaining ones
- posts table date: uses a `span` element instead of an `abbr` element because this is not an abbreviation

Fixes #46980.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-02 21:44:58 +00:00
Felix Arntz 4089fad5fb Formatting: Improve accuracy of `force_balance_tags()` and add support for custom element tags.
This changeset includes a major iteration on the regular expression used to balance tags, with comprehensive test coverage to ensure that all scenarios are supported or unsupported as expected.

Props dmsnell, westonruter, birgire.
Fixes #47014.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-02 10:25:56 +00:00
Peter Wilson b55ca66759 #43590: Use robots meta tag to better discourage search engines.
This changes the "discourage search engines" option to output a `noindex, nofollow` robots meta tag. `Disallow: /` is removed from the `robots.txt` to allow search engines to discover they are requested not to index the site.

Disallowing search engines from accessing a site in the `robots.txt` file can result in search engines listing a site with a fragment (a listing without content).

Props donmhico, jonoaldersonwp.
Fixes #43590.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-02 02:27:55 +00:00
Sergey Biryukov 8662d9a74d I18N: Split translatable strings located on the same line preceded with a translator comment, where the first string needs that comment, but the second does not.
Props johnbillion.
See #44360.
Built from https://develop.svn.wordpress.org/trunk@45927


git-svn-id: http://core.svn.wordpress.org/trunk@45738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-02 00:43:55 +00:00
Sergey Biryukov 16b8d91baa I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Andrea Fercia 3ab18dba93 Accessibility: Add a default title for the media modal dialog.
Makes sure the media modal dialog `h1` heading isn't empty when custom media frames don't set a title. This is particularly important now that the media modal is an ARIA dialog, as the title is referenced by an `aria-labelledby` attribute to properly label the dialog.

Props donmhico, audrasjb.
Fixes #47612.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 15:18:56 +00:00
Sergey Biryukov 7fd6077864 Docs: Improve documentation for `auth_redirect()`.
Props atachibana.
Fixes #47956.
Built from https://develop.svn.wordpress.org/trunk@45924


git-svn-id: http://core.svn.wordpress.org/trunk@45735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 13:03:55 +00:00
Sergey Biryukov f447c32aca Twenty Nineteen: Remove unused jQuery argument passed to an IIFE that accepts no arguments.
Props Christian1012, hareesh-pillai.
Fixes #40333.
Built from https://develop.svn.wordpress.org/trunk@45923


git-svn-id: http://core.svn.wordpress.org/trunk@45734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-31 20:53:54 +00:00
Sergey Biryukov 4d7cc73e17 Twenty Seventeen: Remove unused jQuery argument passed to an IIFE that accepts no arguments.
Props Christian1012, hareesh-pillai.
See #40333.
Built from https://develop.svn.wordpress.org/trunk@45922


git-svn-id: http://core.svn.wordpress.org/trunk@45733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-31 20:52:56 +00:00
Sergey Biryukov ceefe26e9e Twenty Nineteen: Correct file name in JS DocBlocks.
See #47110.
Built from https://develop.svn.wordpress.org/trunk@45921


git-svn-id: http://core.svn.wordpress.org/trunk@45732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-31 20:43:55 +00:00
Sergey Biryukov c9d8c89ebd Twenty Nineteen: Improve compatibility with custom colors in the separator block.
Props kjellr.
Fixes #47811.
Built from https://develop.svn.wordpress.org/trunk@45920


git-svn-id: http://core.svn.wordpress.org/trunk@45731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-30 19:15:56 +00:00
Sergey Biryukov e30696bd20 Twenty Nineteen: Remove Baskerville Old Face from the font stack due to several shortcomings:
* Being difficult to read due to its mix of thin and thick strokes.
* Having poor language/extended character support.
* Not having other weights/styles (bold, italic, etc) and relying on browser approximations of those variants.

The next fonts down the stack (Garamond and Times) are more properly aligned to the appearance of the top-level serif font in the stack (Hoefler Text), and work better in its place.

Props kjellr, Rarst, justintadlock.
Fixes #45881.
Built from https://develop.svn.wordpress.org/trunk@45919


git-svn-id: http://core.svn.wordpress.org/trunk@45730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-30 18:58:57 +00:00
Sergey Biryukov ffcb1d0d99 Comments: In AJAX response when deleting a comment, account for `&nbsp;` as a thousands separator in `total_items_i18n` and `total_pages_i18n` numbers.
Props denisco, SergeyBiryukov.
Fixes #47953.
Built from https://develop.svn.wordpress.org/trunk@45918


git-svn-id: http://core.svn.wordpress.org/trunk@45729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-30 18:34:06 +00:00
Sergey Biryukov d26191eb03 Docs: Simplify `get_plugin_data()` and `get_file_data()` description.
See #47110.
Built from https://develop.svn.wordpress.org/trunk@45917


git-svn-id: http://core.svn.wordpress.org/trunk@45728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-30 16:57:56 +00:00
Sergey Biryukov 3f048f5ace Docs: Update plugin headers example in `get_plugin_data()` to clarify that `Version` is not a required field.
Props casiepa.
See #47110, #meta4707.
Built from https://develop.svn.wordpress.org/trunk@45916


git-svn-id: http://core.svn.wordpress.org/trunk@45727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-30 16:16:57 +00:00
John Blackbourn 640c90d35d Docs: Correct and improve inline docs relating to caching, terms, meta, and some misc tweaks.
See #47110   

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


git-svn-id: http://core.svn.wordpress.org/trunk@45726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-30 11:36:08 +00:00
Sergey Biryukov 16c43f368d Date/Time: Restore the previous behavior of `date_i18n()` where invalid input would result in current time.
Make `wp_date()` return `false` on invalid timestamp input, for consistency with upstream PHP `date()` function.

Props Rarst.
Fixes #28636.
Built from https://develop.svn.wordpress.org/trunk@45914


git-svn-id: http://core.svn.wordpress.org/trunk@45725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 23:18:55 +00:00
Sergey Biryukov 3965d4735c I18N: Add missing translator comment in help text on Reading Settings screen.
Props garrett-eclipse.
See #46708.
Built from https://develop.svn.wordpress.org/trunk@45913


git-svn-id: http://core.svn.wordpress.org/trunk@45724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 21:36:55 +00:00
Sergey Biryukov 7caac01470 Administration: Add a note to "For each post in a feed, include [Full text / Summary]" option that how content is displayed in browsers depends on the theme.
Add a documentation link to learn more about feeds.

Props JarretC, SergeyBiryukov, pento, talldanwp, dinhtungdu, noisysocks, tobifjellner.
Fixes #46708.
Built from https://develop.svn.wordpress.org/trunk@45912


git-svn-id: http://core.svn.wordpress.org/trunk@45723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 21:25:55 +00:00
Sergey Biryukov 4629fa26d2 Date/Time: Update XML-RPC tests for invalid date input to account for a more consistent `mysql2date()` error handling in [45908].
The tests were meant to check for the lack of a fatal error in case of invalid date input, not specifically mark a particular outcome as the correct one.

Props Rarst.
Fixes #28992.
Built from https://develop.svn.wordpress.org/trunk@45911


git-svn-id: http://core.svn.wordpress.org/trunk@45722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 16:44:55 +00:00
Felix Arntz 90c424f73b Multisite: Improve performance by caching not found lookups for sites and networks.
With this change, the result of a site or network lookup by ID will be cached even if the ID does not exist. When a new site or network is created, the cache for the respective new ID is cleared.

Props mnelson4, nielsdeblaauw.
Fixes #42251.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 12:42:56 +00:00
Mike Schroder ccdc221b32 Administration: Output valid HTML when `wp_die()` is called.
To better support HTML and string calls to `wp_die()` without
outputting invalid HTML, wraps error messages in `<div>` rather than `<p>`.

Adds `.wp-die-message` CSS class for styling.

Props dinhtungdu, jeremyfelt, audrasjb, SergeyBiryukov, afercia, audrasjb, noisysocks.
Fixes #47580.
Built from https://develop.svn.wordpress.org/trunk@45909


git-svn-id: http://core.svn.wordpress.org/trunk@45720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 07:54:01 +00:00
Sergey Biryukov 6057b32e9b Date/Time: Revamp `mysql2date()` to use `wp_date()` and handle invalid input in a consistent manner.
Add unit tests, improve documentation.

Props Rarst, pbearne.
Fixes #28992.
Built from https://develop.svn.wordpress.org/trunk@45908


git-svn-id: http://core.svn.wordpress.org/trunk@45719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 05:07:56 +00:00
Sergey Biryukov 29a6063f45 Coding Standards: Fix WPCS issue in [45906].
See #45322.
Built from https://develop.svn.wordpress.org/trunk@45907


git-svn-id: http://core.svn.wordpress.org/trunk@45718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 02:40:54 +00:00
Sergey Biryukov e0adbf69ff XML-RPC: Make sure editing a draft post with `wp.editPost` does not unintentionally cause its published date to be set.
Props redsweater.
Fixes #45322.
Built from https://develop.svn.wordpress.org/trunk@45906


git-svn-id: http://core.svn.wordpress.org/trunk@45717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-29 02:10:56 +00:00
Sergey Biryukov 27a384caa4 Site Health: Merge two similar strings explaining what drop-in plugins are.
Props garrett-eclipse, ramiy, Clorith.
Fixes #47247.
Built from https://develop.svn.wordpress.org/trunk@45905


git-svn-id: http://core.svn.wordpress.org/trunk@45716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-28 03:13:55 +00:00
Sergey Biryukov 6cad27efcd Site Health: Standardize on `SELECT VERSION()` query for checking the database server version, due to the MariaDB version declaration potentially causing issues in production environments.
Partially reverts [45691].

Props Clorith.
Fixes #47738.
Built from https://develop.svn.wordpress.org/trunk@45904


git-svn-id: http://core.svn.wordpress.org/trunk@45715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-28 03:09:52 +00:00
K. Adam White 181d77f04e REST API: Only cast scalar types to string when comparing new & old meta values.
Newly-supported array and object meta types should not be cast to strings.

Props TimothyBlynJacobs, caercam.
Fixes #47928.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-28 03:08:55 +00:00
Sergey Biryukov e3d4e81ca0 Date/Time: Correct delta comparison in `test_should_return_wp_timestamp()`.
See #25768.
Built from https://develop.svn.wordpress.org/trunk@45902


git-svn-id: http://core.svn.wordpress.org/trunk@45713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-28 02:20:54 +00:00
Sergey Biryukov 12aa694ee5 Date/Time: Introduce `wp_date()` to retrieve the date in localized format.
Convert `date_i18n()` into a wrapper for `wp_date()`.

`wp_date()` is intended as a replacement for `date_i18n()` without legacy quirks in it. It accepts a true Unix timestamp (not summed with timezone offset) and an arbitrary timezone.

Props Rarst, mboynes, MikeHansenMe, rmccue, nacin.
Fixes #28636.
Built from https://develop.svn.wordpress.org/trunk@45901


git-svn-id: http://core.svn.wordpress.org/trunk@45712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-28 00:52:56 +00:00
Sergey Biryukov 61d5337aca Date/Time: Remove the last remaining `current_time( 'timestamp' )` instance in `wp_post_revision_title_expanded()`.
Timestamps don't carry any timezone information, using `$revision->post_modified_gmt` simplifies the logic.

Props Rarst.
See #40657.
Built from https://develop.svn.wordpress.org/trunk@45900


git-svn-id: http://core.svn.wordpress.org/trunk@45711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-27 21:55:56 +00:00
Sergey Biryukov 6a7baa24a6 Docs: Clarify that `$name` and `$value` parameters of `set_user_setting()` can contain hyphens.
Props tmatsuur.
Fixes #47938.
Built from https://develop.svn.wordpress.org/trunk@45899


git-svn-id: http://core.svn.wordpress.org/trunk@45710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-27 01:17:55 +00:00
Sergey Biryukov 8750097e4b Docs: Remove a clarification from `do_robots()` description that doesn't really clarify anything.
See #47110.
Built from https://develop.svn.wordpress.org/trunk@45898


git-svn-id: http://core.svn.wordpress.org/trunk@45709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-27 00:17:56 +00:00
Sergey Biryukov cc21760163 Twenty Nineteen: Make sure center-aligned images in columns do not break beyond the column boundaries.
Props kjellr.
Fixes #47937.
Built from https://develop.svn.wordpress.org/trunk@45897


git-svn-id: http://core.svn.wordpress.org/trunk@45708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-26 19:01:55 +00:00
Sergey Biryukov 9dc2a432b1 Twenty Nineteen: Update `style-rtl.css` after [45773].
See #47850.
Built from https://develop.svn.wordpress.org/trunk@45896


git-svn-id: http://core.svn.wordpress.org/trunk@45707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-26 19:00:58 +00:00
Sergey Biryukov baffd21844 Docs: Reference `WP_Term_Query::__construct()` in `wp_list_categories()` DocBlock for additional accepted arguments.
Clarify that `wp_dropdown_categories()` always returns a string, regardless of the `echo` parameter.

See #47896, #47110.
Built from https://develop.svn.wordpress.org/trunk@45895


git-svn-id: http://core.svn.wordpress.org/trunk@45706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-26 17:00:55 +00:00
Boone Gorges d1ac7170dc Taxonomy: Standardize docs for `wp_list_categories()`.
Many of the parameters historically documented on this function are merely
passed through to `get_categories()` and its underlying functions. In order to
avoid unnecessary duplication of function arguments, we remove documentation of
these parameters, and replace it with reference to the wrapped functions.

Parameters that receive special treatment or are otherwise changed before
being passed through continue to be documented as part of `wp_list_categories()`.

Props audrasjb, itowhid06, birgire.
Fixes #47896.
Built from https://develop.svn.wordpress.org/trunk@45894


git-svn-id: http://core.svn.wordpress.org/trunk@45705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-26 15:24:55 +00:00
Boone Gorges e0c83d76d1 Taxonomy: Fix unique-slug check for terms with parents.
`wp_unique_term_slug()` appends numeric suffixes when the requested slug is
already in use by a sibling term. Changes introduced in [32837] inadvertently
caused this suffixing to be skipped in cases where the requested slug is
suffixed with the parent slug, so that it became possible to have two terms
`childslug-parentslug` underneath to the same `parentslug`. We fix this
regression by ensuring that the numeric-suffix routine runs in all cases.

Props yashar_hv, saskak, dlh.
Fixes #46431.
Built from https://develop.svn.wordpress.org/trunk@45893


git-svn-id: http://core.svn.wordpress.org/trunk@45704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-26 15:19:56 +00:00
Andrew Ozz c5fed47367 Docs: Improve and update the description of `multi_resize()` to explain changes and expected use.
See #40439.
Built from https://develop.svn.wordpress.org/trunk@45892


git-svn-id: http://core.svn.wordpress.org/trunk@45703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-25 22:21:58 +00:00
Sergey Biryukov b1847ef3e2 Menus: In `wp_setup_nav_menu_item()` and `Walker_Nav_Menu_Edit::start_el()`, check if the post or term associated with the menu item still exists to avoid a PHP notice.
If the associated post or term no longer exists, mark the menu item as invalid.

Props mehulkaklotar, kamrankhorsandi, cristiano.zanca, SergeyBiryukov.
Fixes #31703.
Built from https://develop.svn.wordpress.org/trunk@45891


git-svn-id: http://core.svn.wordpress.org/trunk@45702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-25 21:32:59 +00:00
Sergey Biryukov fe0b22cd67 Users: Adjust [45806] to make sure `$all_userids` is always defined.
Props kbrownkd.
Fixes #47936.
Built from https://develop.svn.wordpress.org/trunk@45890


git-svn-id: http://core.svn.wordpress.org/trunk@45701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-25 20:03:57 +00:00
Sergey Biryukov c896a0911e Site Health: Add timezone to Site Health Info page.
Props justinahinon, sharaz, artisticasad, Rarst.
Fixes #47842.
Built from https://develop.svn.wordpress.org/trunk@45889


git-svn-id: http://core.svn.wordpress.org/trunk@45700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-24 19:37:57 +00:00
Boone Gorges 17d32ebc8f Taxonomy: Ensure consistency of `hide_empty` in term queries when `taxonomy` is excluded.
When querying for terms in hierarchical categories using `hide_empty=true`,
results have historically included parent terms which are themselves
unattached to any objects (are "empty") but which have non-empty descendent
terms. Because this process involves walking the descendant tree, we avoid it
when we detect that the queried taxonomies are not hierarchical. (This
behavior was introduced in [5525].)

When the `taxonomy` parameter of `get_terms()` was made optional - see #35495,
[36614] - it affected the mechanism for avoiding unneccessary tree walks,
since there may not be any explicitly declared taxonomies to run through
`is_taxonomy_hierarchical()`. As a result, term queries excluding `taxonomy`
did not check descendants, and empty parents with non-empty children were not
included in `hide_empty` results.

We correct the behavior by crawling term descendants when the `taxonomy`
argument is absent, which means that we're querying for terms in all taxonomies.

Props smerriman.
Fixes #37728.
Built from https://develop.svn.wordpress.org/trunk@45888


git-svn-id: http://core.svn.wordpress.org/trunk@45699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 16:05:56 +00:00
Sergey Biryukov 9672302e04 Date/Time: Rewrite and simplify `get_gmt_from_date()`, `get_date_from_gmt()`, and `iso8601_to_datetime()` using `wp_timezone()`.
Improve unit test coverage.

Props Rarst, goodevilgenius.
Fixes #31809.
Built from https://develop.svn.wordpress.org/trunk@45887


git-svn-id: http://core.svn.wordpress.org/trunk@45698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 11:03:56 +00:00
Sergey Biryukov 1aaf11947e Date/Time: Simplify the date comparing logic in `WP_Community_Events::trim_events()`.
The Events API returns event date without timezone information, so trying to parse it into a timestamp and compare to a WP timestamp is pointless.

Props Rarst.
Fixes #47463.
Built from https://develop.svn.wordpress.org/trunk@45886


git-svn-id: http://core.svn.wordpress.org/trunk@45697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 02:15:55 +00:00
Gary Pendergast 601f5f7376 Build Tools: Pass the LOCAL_DIR environment variable through to the phpunit Docker container.
This allows code running inside the container to know whether it's supposed to be running in `build` or `src`.

See #47767.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 01:56:56 +00:00
Sergey Biryukov 6330f10b7d Date/Time: Revert unintended changes from [45882].
Props TimothyBlynJacobs.
See #25768.
Built from https://develop.svn.wordpress.org/trunk@45884


git-svn-id: http://core.svn.wordpress.org/trunk@45695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 01:16:53 +00:00
Sergey Biryukov 6e555f0c77 Date/Time: Introduce `current_datetime()` for better time operations.
Returning a `DateTimeImmutable` representation of the current moment in time, this allows for a more flexible and reliable use than `current_time()` provides.

Props Rarst.
Fixes #47464.
Built from https://develop.svn.wordpress.org/trunk@45883


git-svn-id: http://core.svn.wordpress.org/trunk@45694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 01:12:55 +00:00
Sergey Biryukov 6f8e50c7f0 Date/Time: Rewrite and simplify `date_i18n()` using `wp_timezone()` to address multiple issues with certain date formats and timezones, while preserving some extra handling for legacy use cases.
Improve unit test coverage.

Props Rarst, remcotolsma, raubvogel.
Fixes #25768.
Built from https://develop.svn.wordpress.org/trunk@45882


git-svn-id: http://core.svn.wordpress.org/trunk@45693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 00:57:56 +00:00
desrosj e7c8b21e71 Coding Standards: Dynamic hooks should be named using interpolation not concatenation.
Props arena, desrosj.
Fixes #47052.
Built from https://develop.svn.wordpress.org/trunk@45881


git-svn-id: http://core.svn.wordpress.org/trunk@45692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-22 19:08:55 +00:00
Sergey Biryukov d309715a95 Coding Standards: Add missing `break` for the default case in `wp_privacy_anonymize_data()`.
Props itowhid06.
Fixes #47921.
Built from https://develop.svn.wordpress.org/trunk@45877


git-svn-id: http://core.svn.wordpress.org/trunk@45688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-22 14:50:55 +00:00
Sergey Biryukov 8d919b09d4 Date/Time: Use `wp_timezone()` in `WP_Date_Query::build_mysql_datetime()` to address timezone issues.
Improve unit test coverage.

Props Rarst, Biranit, birgire, jave.web, SergeyBiryukov.
Fixes #41782.
Built from https://develop.svn.wordpress.org/trunk@45876


git-svn-id: http://core.svn.wordpress.org/trunk@45687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-22 03:11:55 +00:00
Gary Pendergast 1f8563d8e7 Build Tools: Don't use git for package installs.
While NPM supports installing packages from git locations, this requires `git` to be in the path, which won't necessarily be true, particularly on Windows.

We can download the release versions for these packages, instead.

Fixes #47916.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-22 02:29:54 +00:00
Sergey Biryukov ad7b2949ba Users: Adjust [45708] to make sure `wp_update_user()` does not issue a `WP_Error` if a single site was previously set up as Multisite and there's still a `spam` field in the user table.
Add a unit test.

Props azaozz, SergeyBiryukov.
Fixes #45747.
Built from https://develop.svn.wordpress.org/trunk@45874


git-svn-id: http://core.svn.wordpress.org/trunk@45685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-22 01:53:55 +00:00
Sergey Biryukov f6fc8025c4 Administration: Adjust [45814] to address a backward compatibility issue for plugins passing multiple CSS classes to `add_settings_error()`.
Only add the `notice-` prefix for `error`, `success`, `warning`, `info` CSS classes, keep other classes as is.

Add unit tests for `settings_errors()`.

Props afercia, SergeyBiryukov.
Fixes #44941.
Built from https://develop.svn.wordpress.org/trunk@45873


git-svn-id: http://core.svn.wordpress.org/trunk@45684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-22 00:22:56 +00:00
Sergey Biryukov 36b4debdb4 Docs: Correct type for the `$deprecated` argument of `get_terms()`.
Props itowhid06.
Fixes #47915.
Built from https://develop.svn.wordpress.org/trunk@45872


git-svn-id: http://core.svn.wordpress.org/trunk@45683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-21 16:27:55 +00:00
Sergey Biryukov 3d12c4b6d8 Docs: Fix typo in `_wp_make_subsizes()` DocBlock.
Props itowhid06.
Fixes #47913. See #40439.
Built from https://develop.svn.wordpress.org/trunk@45871


git-svn-id: http://core.svn.wordpress.org/trunk@45682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-21 16:23:56 +00:00
Sergey Biryukov f8fb93cd0d Customizer: Trim whitespace from custom link URLs.
This complements a similar fix for the Menus screen in [45655].

Props donmhico, audrasjb.
Fixes #47888. See #47723.
Built from https://develop.svn.wordpress.org/trunk@45869


git-svn-id: http://core.svn.wordpress.org/trunk@45680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-21 00:27:57 +00:00
Sergey Biryukov 6b9ab1c5c5 Docs: Update `@since` tag for new JS functions and variables introduced in [45572].
Props garrett-eclipse.
See #47145.
Built from https://develop.svn.wordpress.org/trunk@45867


git-svn-id: http://core.svn.wordpress.org/trunk@45678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 22:54:55 +00:00
Sergey Biryukov 40d4037fa6 Twenty Seventeen: Fix tabs vs. spaces in [45764].
See #47414.
Built from https://develop.svn.wordpress.org/trunk@45863


git-svn-id: http://core.svn.wordpress.org/trunk@45674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 19:12:50 +00:00
Sergey Biryukov 18d991bfc0 Twenty Eleven: Fix tabs vs. spaces in [45763].
See #47414.
Built from https://develop.svn.wordpress.org/trunk@45862


git-svn-id: http://core.svn.wordpress.org/trunk@45673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 19:11:55 +00:00
Sergey Biryukov 561e17c1a4 Twenty Seventeen: Adjust [45764] to conform to CSS Coding Standards.
See #47414.
Built from https://develop.svn.wordpress.org/trunk@45861


git-svn-id: http://core.svn.wordpress.org/trunk@45672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 19:07:49 +00:00
Sergey Biryukov 4a8c0b1498 Twenty Eleven: Adjust [45763] to conform to CSS Coding Standards.
See #47414.
Built from https://develop.svn.wordpress.org/trunk@45860


git-svn-id: http://core.svn.wordpress.org/trunk@45671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 19:06:54 +00:00
Sergey Biryukov 9793494a2c Tests: Remove `$wpdb` global reference from `test_wp_insert_user_with_empty_data()`.
See #47902.
Built from https://develop.svn.wordpress.org/trunk@45859


git-svn-id: http://core.svn.wordpress.org/trunk@45670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 17:28:56 +00:00
Sergey Biryukov 022de7321e Users: In `wp_insert_user()`, account for the `wp_pre_insert_user_data` filter returning empty data.
Props juliobox, SergeyBiryukov.
Fixes #47902.
Built from https://develop.svn.wordpress.org/trunk@45858


git-svn-id: http://core.svn.wordpress.org/trunk@45669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 17:26:55 +00:00
Sergey Biryukov bdb1811935 Date/Time: Fix race conditions in `current_time()` tests.
* Restore default timezone before performing assertions to avoid affecting other tests in case of failure.
* Use delta comparison for timestamps to avoid race conditions.

Props SergeyBiryukov, desrosj.
Fixes #45821.
Built from https://develop.svn.wordpress.org/trunk@45857


git-svn-id: http://core.svn.wordpress.org/trunk@45668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-20 01:35:56 +00:00
Sergey Biryukov 349e9f56c1 Date/Time: Use PHP `DateTime` class API in `current_time()`.
Only use the legacy WP timestamp approach (a sum of timestamp and timezone offset) for `timestamp` and `U` formats without the `$gmt` flag.

Otherwise, make sure the function returns correct local time for any format.

Props Rarst, jdgrimes.
Fixes #40653.
Built from https://develop.svn.wordpress.org/trunk@45856


git-svn-id: http://core.svn.wordpress.org/trunk@45667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 21:07:50 +00:00
Sergey Biryukov 26f8b67e35 Coding Standards: Use long array syntax in `Tests_WP_Timezone::timezone_offset_provider()`.
Per https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/, arrays must be declared using long array syntax for clarity.

See #24730.
Built from https://develop.svn.wordpress.org/trunk@45855


git-svn-id: http://core.svn.wordpress.org/trunk@45666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 21:06:55 +00:00
Sergey Biryukov 46ca606114 Coding Standards: Use `KB_IN_BYTES` in `get_file_data()`.
See #22405, #47632.
Built from https://develop.svn.wordpress.org/trunk@45854


git-svn-id: http://core.svn.wordpress.org/trunk@45665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 20:10:55 +00:00
Sergey Biryukov 4896dc64ee Date/Time: Introduce `wp_timezone_string()` and `wp_timezone()` for unified timezone retrieval.
* `wp_timezone_string()` retrieves the timezone from current settings as a string. Uses the `timezone_string` option to get a proper timezone if available, otherwise falls back to an offset.
* `wp_timezone()` retrieves the timezone from current settings as a `DateTimeZone` object. Timezone can be based on a PHP timezone string or a `±HH:MM` offset.

Props Rarst, remcotolsma, johnjamesjacoby, rmccue.
Fixes #24730.
Built from https://develop.svn.wordpress.org/trunk@45853


git-svn-id: http://core.svn.wordpress.org/trunk@45664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 19:08:59 +00:00
Sergey Biryukov 82af4ad1c0 Coding Standards: Fix WPCS violations in [45851].
See #25347.
Built from https://develop.svn.wordpress.org/trunk@45852


git-svn-id: http://core.svn.wordpress.org/trunk@45663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 16:35:56 +00:00
Sergey Biryukov a58eaa9424 Date/Time: In `wp_insert_post()`, when checking the post date to set `future` or `publish` status, use string comparison to work around far future dates (year 2038+) on 32-bit systems.
Props Rarst, nofearinc.
Fixes #25347.
Built from https://develop.svn.wordpress.org/trunk@45851


git-svn-id: http://core.svn.wordpress.org/trunk@45662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 15:50:56 +00:00
Sergey Biryukov 3541c5d74c Date/Time: In `WP_Date_Query::__construct()`, return early if `$date_query` is empty or not an array.
Props vishalkakadiya.
Fixes #47392.
Built from https://develop.svn.wordpress.org/trunk@45850


git-svn-id: http://core.svn.wordpress.org/trunk@45661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 15:17:56 +00:00
Gary Pendergast 7a92316fd8 Tests: Add an xdebug group for tests that require xdebug.
These tests are now also run as their own part of the Travis build, to ensure performance of other tests isn't affected by the presence of xdebug.

Fixes #40532.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-19 02:18:56 +00:00
Tammie Lister a760ef9022 Multisite: Remove truncation to allow clearers identification of longer site names
Previously the sites were truncated which meant longer names but with ending identifications were unable to be seen as different. This shows the full site name to allow easier understanding.

Props tferry, melinedo, afercia, jeremyfelt
Fixes: 47112

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


git-svn-id: http://core.svn.wordpress.org/trunk@45637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-18 12:31:00 +00:00
Sergey Biryukov d9954ed4cb Privacy: Add descriptions for sections in a personal data export file.
Props garrett-eclipse, Venutius, karmatosed.
Fixes #45491.
Built from https://develop.svn.wordpress.org/trunk@45825


git-svn-id: http://core.svn.wordpress.org/trunk@45636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-18 02:07:57 +00:00
Sergey Biryukov 53f5b172ab Plugins: Adjust margin for plugin headings on "Add Plugins" screen to avoid overlapping with "Network Activate" button.
Props justinahinon, chetan200891.
Fixes #47600.
Built from https://develop.svn.wordpress.org/trunk@45824


git-svn-id: http://core.svn.wordpress.org/trunk@45635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-17 14:33:56 +00:00
Sergey Biryukov cde194a21e Pings/Trackbacks: In `wp_xmlrpc_server::pingback_ping()`, strip inline JS and CSS while trying to figure out the pingback context.
Props david.binda.
Fixes #47283.
Built from https://develop.svn.wordpress.org/trunk@45823


git-svn-id: http://core.svn.wordpress.org/trunk@45634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-17 13:59:55 +00:00
Sergey Biryukov aa8e2ff3ba Docs: Improve documentation for `wp_set_auth_cookie()` and related functions.
Props arafat, SergeyBiryukov.
Fixes #47886.
Built from https://develop.svn.wordpress.org/trunk@45822


git-svn-id: http://core.svn.wordpress.org/trunk@45633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-17 13:23:55 +00:00
John Blackbourn 3796b7da13 Docs: Add a missing return type.
See #47110

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


git-svn-id: http://core.svn.wordpress.org/trunk@45632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-16 19:35:58 +00:00
K. Adam White ca070acae3 Add @ticket annotations for [45812].
Props birgire.
See #43709.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-16 03:33:55 +00:00
Gary Pendergast ea64ea7c96 Build Tools: Improve `local-env` start behaviour under Docker Toolbox.
Docker Toolbox requires port forwarding to be configured, but generates error when trying to forward a port that's already been taken.

This change removes clashing port forwarding rules before adding our own.

See #47767.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-16 01:40:54 +00:00
Sergey Biryukov be6bbe4b5d Administration: Replace legacy `updated` message type in `add_settings_error()` calls with `success`.
See #44640.
Built from https://develop.svn.wordpress.org/trunk@45818


git-svn-id: http://core.svn.wordpress.org/trunk@45629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-16 00:39:55 +00:00
Sergey Biryukov 3f1186166d Taxonomy: In `feed_links_extra()` and `get_the_archive_title()`, make sure the queried taxonomy term exists before accessing its properties.
Props donmhico, truchot, zaantar.
Fixes #46420.
Built from https://develop.svn.wordpress.org/trunk@45817


git-svn-id: http://core.svn.wordpress.org/trunk@45628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-16 00:24:54 +00:00
Sergey Biryukov 06d264d032 Coding Standards: In `wlwmanifest_link()`, use concatenation instead of commas for `echo`, for consistency with `rsd_link()` and the rest of core.
See #47632.
Built from https://develop.svn.wordpress.org/trunk@45816


git-svn-id: http://core.svn.wordpress.org/trunk@45627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-16 00:21:56 +00:00
K. Adam White 34bc7ab089 REST API: Add @ticket annotation to test from [45813].
Props birgire.
See #42209.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 23:09:54 +00:00
Sergey Biryukov e5deae5e78 Administration: In `add_settings_error()`, add `warning` and `info` as possible values for message type.
Account for these new values in `settings_errors()`, resulting in `notice-warning` and `notice-info` CSS classes.

Map legacy `error` and `updated` CSS classes to `notice-error` and `notice-success`.

Props donmhico, toddhalfpenny, flixos90, desrosj, javorszky, SergeyBiryukov.
Fixes #44640, #44941.
Built from https://develop.svn.wordpress.org/trunk@45814


git-svn-id: http://core.svn.wordpress.org/trunk@45625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 23:01:55 +00:00
K. Adam White 7eed5eff61 REST API: Always return post types list in taxonomies endpoint response as an array.
Prevents a non-sequential post type array such as [ 0 => 'post', 2 => 'page' ] from being improperly converted to an object in the taxonomy endpoint's response JSON.

Props TimothyBlynJacobs, birgire, spectacula.
Fixes #42209.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 22:12:55 +00:00
K. Adam White 00cb4c7dbd REST API: Prevent deletion of post revisions.
Allowing the client to delete revisions breaks the "audit trail" functionality. This is not allowed in WordPress and shouldn't be allowed through the API.
While not recommended, a plugin may opt-in to the previous behavior by setting a custom 'delete_post' capability for the revisions post type.

Props dlh, danielbachhuber, TimothyBlynJacobs, azaozz, kadamwhite.
Fixes #43709.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 22:01:55 +00:00
K. Adam White 5dbb64d0dd REST API: Cache results of get_item_schema on controller instances for performance.
Caches the output of get_item_schema() to avoid redundant recomputation of translatable strings and other computed values. This method is called many times per item in each REST request, and the results of the method should not vary between calls.
Additional schema fields are not cached.

Props kadamwhite, joehoyle, TimothyBlynJacobs.
Fixes #47871.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 21:09:55 +00:00
K. Adam White dbfa0c7ed4 REST API: Clarify arguments passed to rest route get & update callbacks.
Update doc block argument definitions to clarify that the REST API always passes an array to the `get_callback` and always passes an entity object to the `update_callback`.

Props TimothyBlynJacobs, salzano.
Fixes #44432.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 20:04:55 +00:00
K. Adam White 8dcc10693f REST API: Do not send response body if status is 204 or body is null.
Status code 204 should indicate no response body is sent. Previously, a "null" string was sent, which MacOS Safari would try to parse as JSON and thereby fail to complete the request.

Props TimothyBlynJacobs, andizer, matthias.thiel.
Fixes #43691.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 19:56:55 +00:00
K. Adam White b75420443c REST API: Add test class file incorrectly omitted from [45807].
Props @TimothyBlynJacobs.
See #43392.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 17:21:55 +00:00
K. Adam White 5b318f1dda REST API: Support 'object' and 'array' types in register_meta() schemas.
Extends meta registration to support complex schema values, mirroring the functionality in the settings controller.
Error when trying to modify a meta key containing schema-nonconformant data.

Props @TimothyBlynJacobs, @birgire, @mnelson4, @flixos90.
Fixes #43392.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 17:17:55 +00:00
Sergey Biryukov ab0b860db9 Users: When deleting users, exclude the current user from the content existence check.
The current user cannot be deleted, so the check is redundant in that context and should only be done for other users.

Props mt8.biz, SergeyBiryukov.
Fixes #47851.
Built from https://develop.svn.wordpress.org/trunk@45806


git-svn-id: http://core.svn.wordpress.org/trunk@45617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 13:06:55 +00:00
Gary Pendergast 7169586254 Schema: Add an index to `wp_options.autoload`.
Most sites will be unaffected by this change, but those with a large number of rows in `wp_options`, only a small number of which have `autoload` set, will see a significant performance improvement.

Sites with a large number of rows in `wp_options`, with many of them having `autoload` set will unfortunately see a performance penalty on top of the already very slow queries they're running, but this should be the minority of cases.

Props DanBUK.
Fixes #24044.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 07:13:55 +00:00