Commit Graph

40324 Commits

Author SHA1 Message Date
Sergey Biryukov
26ae8b54d1 Coding Standards: Fix WPCS issue in [46088].
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@46089 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-10 20:00:36 +00:00
Sergey Biryukov
159c78c853 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46088 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-10 19:22:07 +00:00
Sergey Biryukov
b3b64db570 Docs: Clarify the int return value in comments_pre_query filter DocBlock.
See #45800.

git-svn-id: https://develop.svn.wordpress.org/trunk@46087 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-10 19:03:04 +00:00
Adam Silverstein
4ba54c2104 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@46086 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-10 18:41:03 +00:00
Sergey Biryukov
23b6ca3bcb 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46085 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-09 00:06:29 +00:00
Sergey Biryukov
8aa380cf54 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46084 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-08 23:52:43 +00:00
Sergey Biryukov
acadc5cfdd 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46083 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-08 23:23:26 +00:00
Sergey Biryukov
4bd76c15b5 Docs: Fix typo in WP_Hook::resort_active_iterations() description.
Props itowhid06.
Fixes #47999.

git-svn-id: https://develop.svn.wordpress.org/trunk@46082 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-08 13:15:19 +00:00
Andrew Ozz
275f9baeec Upload: Reset the temp upload reference in Plupload when the file is not an image.
See #47872.

git-svn-id: https://develop.svn.wordpress.org/trunk@46081 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-08 02:27:51 +00:00
Sergey Biryukov
d48d56e101 Posts, Post Types: Revert [46079] pending test failure investigation.
See #47824.

git-svn-id: https://develop.svn.wordpress.org/trunk@46080 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-07 19:32:42 +00:00
Sergey Biryukov
69054687be Posts, Post Types: Avoid a PHP warning when the_content() is called outside of the loop.
Fixes #47824.

git-svn-id: https://develop.svn.wordpress.org/trunk@46079 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-07 14:32:23 +00:00
Andrew Ozz
b545a56189 Fix "white spaces at end of line" in docblock (IDE) woes after [46077].
See #32437.

git-svn-id: https://develop.svn.wordpress.org/trunk@46078 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-07 02:11:50 +00:00
Andrew Ozz
ba033e4c6f 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46077 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-07 01:33:16 +00:00
Andrew Ozz
f6a89120ee 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46076 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-07 01:06:49 +00:00
Andrew Ozz
468629720c Uploads: Improve the error message shown when all attempts to create image sub-sizes fail.
Props afercia.
See #47872.

git-svn-id: https://develop.svn.wordpress.org/trunk@46075 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-06 23:47:05 +00:00
Jake Spurlock
e1665da922 Remove the extra call for wp-sanitize from the script loader.
Fixes #47986


git-svn-id: https://develop.svn.wordpress.org/trunk@46073 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-06 21:48:22 +00:00
Sergey Biryukov
c95616cb63 Upgrade/Install: Escape the % in width="100%" in a printf() call in Plugin_Upgrader_Skin::after().
Props afragen.
Fixes #47989.

git-svn-id: https://develop.svn.wordpress.org/trunk@46072 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-06 06:25:19 +00:00
Sergey Biryukov
8b17f6caee Docs: Improve documentation for do_meta_boxes action.
Props felipeelia, killua99, SergeyBiryukov.
Fixes #46542.

git-svn-id: https://develop.svn.wordpress.org/trunk@46071 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-06 00:05:10 +00:00
Sergey Biryukov
419bb36595 REST API: Mark WP_REST_Users_Controller::update_current_item() and ::delete_current_item() as public.
Props dkarfa.
Fixes #47967.

git-svn-id: https://develop.svn.wordpress.org/trunk@46070 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-05 23:17:19 +00:00
Sergey Biryukov
800b8cf5ec Docs: Remove extra spaces in various REST API DocBlocks.
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@46069 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-05 23:04:05 +00:00
Sergey Biryukov
32086d74fc Docs: Correct DocBlocks for WP_REST_Posts_Controller::get_available_actions() and WP_REST_Revisions_Controller::get_parent().
Props dkarfa.
Fixes #47966.

git-svn-id: https://develop.svn.wordpress.org/trunk@46068 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-05 22:58:50 +00:00
Andrew Ozz
58dd5e793f Fix (unrelated) test after [46066].
See #43524.

git-svn-id: https://develop.svn.wordpress.org/trunk@46067 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-05 22:52:29 +00:00
Andrew Ozz
a38ecee8c9 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46066 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-05 22:26:50 +00:00
Andrea Fercia
a211ce8f99 Widgets: Fix "jumpiness" when reordering widgets by dragging them.
Props ketanumretiya030, mukesh27, andraganescu, audrasjb.
Fixes #46941.


git-svn-id: https://develop.svn.wordpress.org/trunk@46028 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 19:32:07 +00:00
Sergey Biryukov
bd299597d5 Coding Standards: Fix WPCS issue in [45990].
git-svn-id: https://develop.svn.wordpress.org/trunk@46019 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 18:40:13 +00:00
Jonathan Desrosiers
cda102f72f Fix for URL sanitization that can lead to cross-site scripting (XSS) attacks.
Props irsdl, sstoqnov, whyisjake.

git-svn-id: https://develop.svn.wordpress.org/trunk@45997 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 17:51:33 +00:00
Sergey Biryukov
b91c405069 Improve handling the existing rel attribute in wp_rel_nofollow_callback().
Props xknown, sstoqnov.

git-svn-id: https://develop.svn.wordpress.org/trunk@45990 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 17:36:46 +00:00
Jake Spurlock
c957e2573e Update wp.a11y.speak() to sanitize HTML before display.
Props iandunn, adamsilverstein, sstoqnov, peterwilsoncc


git-svn-id: https://develop.svn.wordpress.org/trunk@45979 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 17:11:22 +00:00
Sergey Biryukov
8552a9af15 Improve URL validation in wp_validate_redirect().
Props vortfu, whyisjake, peterwilsoncc.

git-svn-id: https://develop.svn.wordpress.org/trunk@45971 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:56:33 +00:00
Andrea Fercia
a1fd37e413 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@45964 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:45:58 +00:00
Andrea Fercia
8aab6352f2 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@45942 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:26:50 +00:00
Sergey Biryukov
a04e391085 Escape the output in wp_ajax_upload_attachment().
Props whyisjake, sstoqnov.

git-svn-id: https://develop.svn.wordpress.org/trunk@45936 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:08:03 +00:00
Jake Spurlock
7f033deee5 Remove _convert_urlencoded_to_entities() from the get_the_content() callback.
Props vortfu, whyisjake, peterwilsoncc


git-svn-id: https://develop.svn.wordpress.org/trunk@45935 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:03:56 +00:00
Andrew Ozz
759ee944c6 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45934 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 01:10:57 +00:00
Sergey Biryukov
29ad3071a3 I18N: Fix typo in a function name in [45932].
See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45933 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:56:42 +00:00
Sergey Biryukov
00b03f2a6f I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45932 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:39:13 +00:00
Andrea Fercia
aed8c497cb Accessibility: Improve focus styles for legacy modal dialogs powered by jQuery UI.
Fixes #47944.


git-svn-id: https://develop.svn.wordpress.org/trunk@45931 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 21:48:29 +00:00
Andrea Fercia
e12f3793d5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@45930 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 21:43:39 +00:00
Felix Arntz
ac2df4e8db 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@45929 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 10:24:18 +00:00
Peter Wilson
122cb2864b #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.



git-svn-id: https://develop.svn.wordpress.org/trunk@45928 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 02:26:55 +00:00
Sergey Biryukov
d0db5be1fe 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45927 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-02 00:42:01 +00:00
Sergey Biryukov
a7513ac8e0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45926 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 17:12:43 +00:00
Andrea Fercia
425d6fd925 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@45925 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 15:17:37 +00:00
Sergey Biryukov
e2b68a4253 Docs: Improve documentation for auth_redirect().
Props atachibana.
Fixes #47956.

git-svn-id: https://develop.svn.wordpress.org/trunk@45924 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 13:02:29 +00:00
Sergey Biryukov
27c877e2b9 Twenty Nineteen: Remove unused jQuery argument passed to an IIFE that accepts no arguments.
Props Christian1012, hareesh-pillai.
Fixes #40333.

git-svn-id: https://develop.svn.wordpress.org/trunk@45923 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-31 20:52:07 +00:00
Sergey Biryukov
08a91859dd Twenty Seventeen: Remove unused jQuery argument passed to an IIFE that accepts no arguments.
Props Christian1012, hareesh-pillai.
See #40333.

git-svn-id: https://develop.svn.wordpress.org/trunk@45922 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-31 20:51:45 +00:00
Sergey Biryukov
9abbd90d30 Twenty Nineteen: Correct file name in JS DocBlocks.
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45921 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-31 20:42:27 +00:00
Sergey Biryukov
9445634e0c Twenty Nineteen: Improve compatibility with custom colors in the separator block.
Props kjellr.
Fixes #47811.

git-svn-id: https://develop.svn.wordpress.org/trunk@45920 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 19:14:23 +00:00
Sergey Biryukov
6f22a931ff 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45919 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 18:57:51 +00:00
Sergey Biryukov
5377bc484b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45918 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-30 18:32:14 +00:00