Commit Graph

40331 Commits

Author SHA1 Message Date
Jonathan Desrosiers
0ff7ebdd97 Docs: Improve documentation for the supports argument in register_post_type()/add_post_type_support().
Follow up of [46160].

Fixes #40413.

git-svn-id: https://develop.svn.wordpress.org/trunk@46246 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 16:07:23 +00:00
Anthony Burchell
3363eaa22d Media: Sets post_id optional in media_sideload_image() and media_handle_sideload().
Props SergeyBiryukov, donmhico, mikeschroder, sebastian.pisula.
Fixes #43579.


git-svn-id: https://develop.svn.wordpress.org/trunk@46245 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 16:02:38 +00:00
Andrea Fercia
036973ba27 Accessibility: Improve and modernize user interface controls for better contrast. Fourth part: Media Views form controls.
Props anevins, audrasjb, nrqsnchzm, kjellr, karmatosed.
Fixes #47150.


git-svn-id: https://develop.svn.wordpress.org/trunk@46244 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 15:48:32 +00:00
Andrea Fercia
3f58ce59d7 Accessibility: Improve and modernize user interface controls. Third part: allow buttons and form controls to scale with text.
Props kjellr, abrightclearweb, audrasjb.
Fixes #47477.


git-svn-id: https://develop.svn.wordpress.org/trunk@46243 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 15:26:23 +00:00
Andrea Fercia
82bded36f8 Accessibility: Improve and modernize user interface controls for better contrast. Second part: tables, meta boxes, and other user interface elements.
Introduces better contrast for borders of the following user interface elements:
- Tables
- Screen Options and Help 
- Admin notices
- Welcome panel
- Meta boxes (post boxes)
- Cards
- Health Check accordions and headings
- Theme and Plugin upload forms

Props kjellr, melchoyce, karmatosed, audrasjb.
Fixes #48101.


git-svn-id: https://develop.svn.wordpress.org/trunk@46242 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 15:09:59 +00:00
Andrea Fercia
94211aeb05 Accessibility: Improve and modernize user interface controls for better contrast. First part: buttons and links.
- Introduces new styles for the buttons, with better contrast for borders and better focus style.
- Introduces a new focus style for links.
- The new styles improve consistency with the ones used in the new Block Editor (Gutenberg).

Props michaelarestad, truchot, mor10, kellychoffman, adamsoucie, paaljoachim, Joen, kjellr, melchoyce, karmatosed, audrasjb, afercia.
Fixes #34904.


git-svn-id: https://develop.svn.wordpress.org/trunk@46241 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 14:42:36 +00:00
Andrea Fercia
42b5133a25 Accessibility: Menus: Improve the menu items "Select All".
- changes "Select All" from a link to a checkbox
- the new checkbox is available only when JavaScript support is on
- semantically and for accessibility, a checkbox is a better user interface control because the available action is clear to all users and the selected state is communicated natively
- it's consistent with the existing pattern for the admin tables

Props birgire, audrasjb, afercia.
Fixes #47048.


git-svn-id: https://develop.svn.wordpress.org/trunk@46240 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 12:41:14 +00:00
Andrea Fercia
01b18e824f Accessibility: Media: Make screen readers announce the Media search results.
- adds audible messages via `wp.a11y.speak()` to announce the search results 
- removes a `keyup` event that was there only to support old browsers 
- removes `aria-modal="true"` from the media modal dialog as it prevents the ARIA live regions to be perceived by screen readers
- triggers the search only after 2 ASCII characters have been typed

Props anevins, antpb, aduth, loreleiaurora, afercia.
Fixes #47146.


git-svn-id: https://develop.svn.wordpress.org/trunk@46239 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 12:18:53 +00:00
Mike Schroder
8fdabdb621 Media: Prevent unnecessary whitespace around PDF Thumbnails.
Stops unintended whitespace from showing around PDF thumbnails
when the PDF creation tool utilized a CropBox.

Props michelweimerskirch, joemcgill.
Fixes #45598.

git-svn-id: https://develop.svn.wordpress.org/trunk@46238 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 10:35:45 +00:00
Andrea Fercia
c9a2fde66e Media: Fix buttons group layout for Internet Explorer 11 after [45499].
Props sabernhardt, afercia.
See #47122.
Fixes #48087.


git-svn-id: https://develop.svn.wordpress.org/trunk@46237 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 09:59:15 +00:00
Andrea Fercia
21030b6b21 Accessibility: Make sure the navigation ARIA landmarks used for posts and comments navigation are properly labelled.
The `<nav>` element defines an ARIA landmark by default: landmarks help assistive technology users to perceive the page main sections and jump through them. However, when a landmark is used more than once in a page, it needs to be distinguished from the other ones to let users understand what the landmark is about.

Adds an `aria-label` parameter to the following functions: 

- `_navigation_markup()`
- `get_the_post_navigatio()`
- `get_the_posts_navigation()`
- `get_the_posts_pagination()`
- `get_the_comments_navigation()`
- `get_the_comments_pagination()`

Props sabernhardt, williampatton, SergeyBiryukov, audrasjb.
Fixes #47123.


git-svn-id: https://develop.svn.wordpress.org/trunk@46236 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-22 22:31:34 +00:00
Peter Wilson
123c17536f KSES: Add support for modern layout techniques in style attribute.
Adds support for `flex`, `grid` and `column` layout techniques to the list of CSS attributes considered safe for inline CSS. The `\` character and CSS functions, eg `minmax()` are not yet supported.

Extends support of `border` properties to include `border-radius` and individual `background` properties to include all those implicitly supported by the shorthand attribute.

Props mrahmadawais, marybaum, birgire, peterwilsoncc, azaozz.
Fixes #37248.
See #47367.


git-svn-id: https://develop.svn.wordpress.org/trunk@46235 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-22 22:16:19 +00:00
Andrea Fercia
975812c783 Accessibility: Twenty Nineteen: Improve the special pages headings.
Improves information provided by the headings, their alignment and spacing in the following special pages:
- search page with and without search results
- 404 page (no content)
- archive pages

Props ianbelanger, kjellr, nrqsnchz, audrasjb.
Fixes #47140.


git-svn-id: https://develop.svn.wordpress.org/trunk@46234 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-22 21:58:06 +00:00
K. Adam White
308e86cd78 REST API: Consistently default URL scheme to "rest", not "json".
The "json" scheme is a holdover from the pre-merge plugin version of the REST API, and was corrected elsewhere in core in [34300]. Only "rest" is officially supported in `set_url_scheme()`.

Props DrewAPicture, rmccue.
Fixes #45169.


git-svn-id: https://develop.svn.wordpress.org/trunk@46233 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-22 19:14:03 +00:00
John Blackbourn
6bd7097626 Docs: Docblock corrections and improvements, mostly related to various pre_* filters.
See #47110


git-svn-id: https://develop.svn.wordpress.org/trunk@46232 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 17:40:58 +00:00
Dominik Schilling
144c5f760d Site Health: Don't verify SSL certificate when testing the local site.
The SSL certificate may be self-signed which prevents various tests from returning proper results. Since the Cron API and file editors don't verify the certificate the tests shouldn't either.

Props Clorith, ocean90.
Fixes #47957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46231 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 16:05:13 +00:00
Dominik Schilling
e6ea695f5a File Editor: Don't verify SSL certificate when doing loopback requests for checking for fatal errors.
Props Clorith.
See #47957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46230 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 15:58:38 +00:00
ocean90
cb076cab0d I18N: Remove HTML tags from translatable string in wp-login.php.
See #46349.

git-svn-id: https://develop.svn.wordpress.org/trunk@46229 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 15:53:02 +00:00
Dominik Schilling
39fff01a1f Site Health: Replace wp_get_upload_dir() with wp_upload_dir().
`wp_get_upload_dir()` returns the theoretical path of the uploads directory. When there was no upload yet the test returns an incorrect result (not writeable) because the directory doesn't exist. Switching to `wp_upload_dir()`, which creates the directory on the fly, ensures a proper test result.

Fixes #47958.

git-svn-id: https://develop.svn.wordpress.org/trunk@46228 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 15:48:56 +00:00
Sergey Biryukov
2d1e8ada5e Coding Standards: Add missing break for the default case in get_default_comment_status(().
Props itowhid06.
Fixes #48095.

git-svn-id: https://develop.svn.wordpress.org/trunk@46227 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 13:49:04 +00:00
Sergey Biryukov
d6749c7669 Docs: Correct type for the $data parameter of WP_Theme::cache_add().
Props itowhid06.
Fixes #48096.

git-svn-id: https://develop.svn.wordpress.org/trunk@46226 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 13:47:12 +00:00
Sergey Biryukov
4eb545aba0 Code Modernization: Use the ** operator instead of the pow() function in wp_convert_bytes_to_hr() for better performance.
Use the `MB_IN_BYTES` constant instead of the `pow()` function in `WP_Customize_Manager::_validate_header_video()` for better readability.

Props ayeshrajans, jrf.
Fixes #48083.

git-svn-id: https://develop.svn.wordpress.org/trunk@46225 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 12:48:29 +00:00
Sergey Biryukov
4d6ca5bfe5 Tests: Correct assertion in test_wp_validate_boolean() to make sure the return type is properly tested.
Props jrf.
Fixes #39868.

git-svn-id: https://develop.svn.wordpress.org/trunk@46224 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 10:28:53 +00:00
John Blackbourn
1199a99f73 Docs: Improve the docs for comment counting related functions.
See #47110, #48093


git-svn-id: https://develop.svn.wordpress.org/trunk@46223 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 10:01:05 +00:00
Sergey Biryukov
0bd3d78db1 Tests: Remove a workaround for str_getcsv().
The `str_getcsv()` function was introduced in PHP 5.3.0, so no longer needs a polyfill.

Props jrf.
Fixes #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46222 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:43:50 +00:00
Sergey Biryukov
5f0fb23a3b Tests: Remove a workaround for get_called_class().
The `get_called_class()` function was introduced in PHP 5.3, so no longer needs a workaround.

Mark `WP_UnitTestCase_Base::get_called_class()` as deprecated. Leave it in place for now as plugins or themes using the WP unit test framework might still call this method.

Props jrf.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46221 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:39:23 +00:00
Sergey Biryukov
4ee97a4ac3 Code Modernization: Remove workarounds for spl_object_hash().
The `spl_object_hash()` function was introduced in PHP 5.2.0. As of PHP 5.3, the PHP SPL extension can no longer be disabled, so these workarounds are no longer needed.

Props jrf.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46220 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:33:13 +00:00
Sergey Biryukov
3a49864e41 Tests: Remove a test for rest_preload_api_request() only relevant for PHP 5.2.
Props dkarfa.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46219 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:26:18 +00:00
Sergey Biryukov
8e454ba7f8 Code Modernization: Remove a workaround for CURLOPT_PROTOCOLS in WP_Http_Curl::request().
The `CURLOPT_PROTOCOLS` constant was introduced in PHP 5.2.10, so no longer needs a workaround.

Props jrf.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46218 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:22:38 +00:00
Sergey Biryukov
f3a0da9fca Code Modernization: Remove a workaround for IMAGETYPE_ICO in file_is_displayable_image().
The `IMAGETYPE_ICO` constant was introduced in PHP 5.3, so no longer needs a workaround.

Props jrf.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46217 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:17:48 +00:00
Sergey Biryukov
8991815b62 Code Modernization: Remove a workaround for HHVM in WP_Image_Editor_Imagick::test().
Support for HHVM was dropped in 2017 via #40548.

Props jrf.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46216 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:12:06 +00:00
Sergey Biryukov
9fd60c9e57 Docs: Update a comment about pcre.backtrack_limit upper limit in benchmark_pcre_backtracking().
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46215 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:06:40 +00:00
Sergey Biryukov
099adc0243 Code Modernization: Remove all code using a version_compare() with a PHP version older than PHP 5.6.
Props jrf.
Fixes #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46214 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:01:36 +00:00
Sergey Biryukov
92d70ed696 Tests: Replace "blog" reference in a comment about DISABLE_WP_CRON usage with "site".
Props davidbaumwald.
Fixes #48089.

git-svn-id: https://develop.svn.wordpress.org/trunk@46213 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 21:58:42 +00:00
Jonathan Desrosiers
8de962479d Docs: Add missing $which parameter descriptions.
Follow up of [46211].

See #45954.

git-svn-id: https://develop.svn.wordpress.org/trunk@46212 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:56:49 +00:00
Jonathan Desrosiers
e31bd15ab5 Networks and Sites: Add support for the extra_tablenav() method in WP_MS_Sites_List_Table.
This method allows additional filters or other UI components to be added to the top and bottom of the `WP_List_Table` between the bulk actions dropdown and search input field.

Fixes #45954.
Props pbiron, desrosj.

git-svn-id: https://develop.svn.wordpress.org/trunk@46211 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:52:58 +00:00
Sergey Biryukov
6b65af939f Code Modernization: Remove conditional use of PHP realpath().
The `realpath()` function was introduced in PHP 4.0.0. There's no point in checking if the function exists in PHP 5.6+, in only 2 instances out of 29.

Props jrf.
Fixes #48075.

git-svn-id: https://develop.svn.wordpress.org/trunk@46210 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:45:58 +00:00
Sergey Biryukov
6922b15e3a Privacy: Display group items count in the personal data export file if there's more than one item in the group.
Props birgire, garrett-eclipse, pputzer.
Fixes #46895.

git-svn-id: https://develop.svn.wordpress.org/trunk@46209 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:29:30 +00:00
Jonathan Desrosiers
946cadaf3d Code Modernization: Remove JSON related polyfills.
The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.

This change removes the `json_last_error_msg()` and `JsonSerializable` polyfills included in WordPress for full JSON extension support in PHP < 5.6.

Follow up of [46205-46206].

See #47699.
Props jrf, Clorith, pento.

git-svn-id: https://develop.svn.wordpress.org/trunk@46208 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:15:51 +00:00
Adam Silverstein
dcd3371c3b Media: make search input full width on mobile. Take two.
Props m1tk00.
Fixes #40130.



git-svn-id: https://develop.svn.wordpress.org/trunk@46207 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:07:53 +00:00
Jonathan Desrosiers
f6b8632508 Code Modernization: Remove JSON extension workarounds for PHP < 5.6.
The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.

This change removes code that supported JSON related functionality on older versions of PHP. This includes (but is not limited to) checks that `json_last_error()` exists, checking and setting the `JSON_UNESCAPED_SLASHES` and `JSON_PRETTY_PRINT` constants if not previously defined, and deprecating the `_wp_json_prepare_data()` function (which was 100% workaround code).

Follow up of [46205].

See #47699.
Props jrf, Clorith, pento.

git-svn-id: https://develop.svn.wordpress.org/trunk@46206 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:07:28 +00:00
Jonathan Desrosiers
080e7a609e Code Modernization: Deprecate the Services_JSON and Services_JSON_Error classes.
The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.

Since there are still some plugins and themes that utilize the `Services_JSON` class, these classes will remain for the time being, but including the `wp-includes/class-json.php` file and creating `Services_JSON` instances will now throw deprecated notices.

See #47699.
Props jrf, Clorith, pento.

git-svn-id: https://develop.svn.wordpress.org/trunk@46205 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 19:52:38 +00:00
Andrew Ozz
66ef5ec15b Remove left-over debug code after [46203].
See #46349.

git-svn-id: https://develop.svn.wordpress.org/trunk@46204 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 19:26:33 +00:00
Andrew Ozz
388e7fe7f4 Admin email verification:
- Fix wording of the HTML title.
- Add hidden `(opens in a new tab)` to links that need it.
- Add the `screen-reader-text` CSS class to login.css.
- Add another translator comment.

Props afercia.
See #46349.


git-svn-id: https://develop.svn.wordpress.org/trunk@46203 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 18:50:19 +00:00
Andrew Ozz
89939327e3 Media/Upload: rotate images on upload according to EXIF Orientation.
Props msaggiorato, wpdavis, markoheijnen, dhuyvetter, msaggiorato, n7studios, triplejumper12, pbiron, mikeschroder, joemcgill, azaozz.

Fixes #14459.

git-svn-id: https://develop.svn.wordpress.org/trunk@46202 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 18:20:26 +00:00
Sergey Biryukov
188fe7eb2f Docs: Correct @since tag for comments_popup public query variable removed in [35848].
Props hareesh-pillai.
Fixes #48080.

git-svn-id: https://develop.svn.wordpress.org/trunk@46201 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 17:43:13 +00:00
Jonathan Desrosiers
e269403184 Build/Test Tools: Specify PHP 5.6 as the required version of PHP in Composer.
Props ayeshrajans, jrf, netweb.
Fixes #48081.

git-svn-id: https://develop.svn.wordpress.org/trunk@46200 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 17:32:23 +00:00
Jonathan Desrosiers
a4e8fe2145 Site Health: Use sentence casing consistently in header tags.
Props SergeyBiryukov, ajayghaghretiya1, ronakganatra, mukesh27, Clorith.
Fixes #47298.

git-svn-id: https://develop.svn.wordpress.org/trunk@46199 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 17:25:38 +00:00
Sergey Biryukov
1a6d41b4d6 Docs: Add @since tag for the new $position argument added to add_submenu_page() and related functions in [46197].
See #39776.

git-svn-id: https://develop.svn.wordpress.org/trunk@46198 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 17:05:26 +00:00
Adam Silverstein
78e8100b6b Menus: add a position argument to add_submenu_page and the helper functions that use it.
Add a position argument to the `add_submenu_page` function similar to the one already in `add_menu_page`. When adding sub menus enables setting the position in the sub menu where the item should appear.

In addition, add the position argument to functions that call `add_submenu_page` under the hood: `add_management_page`, `add_options_page`, `add_theme_page`, `add_plugins_page`, `add_users_page`, `add_dashboard_page`, `add_posts_page`, `add_media_page`, `add_links_page`, `add_pages_page` and `add_comments_page`.

Props welcher, birgire, alexvorn2.
Fixes #39776.



git-svn-id: https://develop.svn.wordpress.org/trunk@46197 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 14:59:04 +00:00