43951 Commits

Author SHA1 Message Date
Sergey Biryukov
524f2b1f23 Docs: Correct the aria-current array key in the documentation for two widget filters.
This applies to `nav_menu_link_attributes` and `page_menu_link_attributes` filters.

Follow-up to [42808], [44416].

Props jnylen0, chetan200891, alexstine.
See #43522, #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50823 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-07 09:45:40 +00:00
Sergey Biryukov
ea4707d927 Media: Avoid an infinite loop between wp_getimagesize() and wp_get_image_mime().
As a result of the recent changes, both functions were calling each other if the `exif` PHP extension is not available.

The issue is now resolved by calling the `getimagesize()` PHP function directly, instead of the `wp_getimagesize()` wrapper.

Follow-up to [50146], [50810], [50814], [50815], [50818-50821].

See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50822 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-07 09:31:01 +00:00
Sergey Biryukov
630399eb20 Media: Remove an extra variable and a redundant check in WP_Image_Editor_Imagick::set_quality().
`wp_get_webp_info()` returns either a string or `false` for the `type` key, so we can just check for the string directly.

Follow-up to [50810], [50814], [50815], [50818-50820].

See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50821 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-06 15:03:32 +00:00
Sergey Biryukov
08b4cab653 Docs: Correct documentation for wp_get_webp_info() return results.
Follow-up to [50810], [50814], [50815], [50818], [50819].

See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50820 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-06 13:57:18 +00:00
Sergey Biryukov
2c9bc14b94 Media: Remove _wp_webp_is_lossy() for now.
The function was only used in a single place in core.

Follow-up to [50810], [50814], [50815], [50818].

Props johnjamesjacoby.
See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50819 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-06 11:09:34 +00:00
Sergey Biryukov
784a0cd87a Media: Correct an early return condition in wp_get_webp_info().
Previously, this would only have evaluated to `true` if `wp_get_image_mime()` returned `false`.

Follow-up to [50810], [50814], [50815].

See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50818 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-06 10:19:42 +00:00
Jonathan Desrosiers
970f904de5 Site Health: Include more ImageMagick/Imagick information in the Media Handling section.
This adds additional information to the Media Handling section of the Site Health Info page. When ImageMagick is used as the site’s image editor, a full list of file formats supported will now be shown. This will help site owners debug any issues they encounter as support for newer, more modern image formats is added (such as WebP in [50810]).

Additionally, the version of Imagick installed. This will help site owners debug issues with generating images on the PHP side.

Some variables have also been renamed to more accurately represent what is being stored.

Props Clorith, desrosj.
Fixes #53022.

git-svn-id: https://develop.svn.wordpress.org/trunk@50817 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-05 19:20:55 +00:00
David Baumwald
7ca9b459e5 Comments: Remove fourth parameter on remove_filter call.
In `class-walker-comment.php`, a `remove_filter` call on `comment_text` passed a fourth parameter which was not needed.  This change removes the extra argument.

Props diddledan, SergeyBiryukov.
Fixes #53113.

git-svn-id: https://develop.svn.wordpress.org/trunk@50816 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-05 18:53:54 +00:00
Sergey Biryukov
bf17cc67ce Media: Move retrieving WebP image size information into wp_getimagesize().
Remove `_wp_get_image_size()`.

Follow-up to [50146], [50810], [50814].

Props johnjamesjacoby.
See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50815 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-05 18:46:10 +00:00
Sergey Biryukov
462560edba Media: Some documentation and test improvements for WebP support:
* Document that WebP constants are only defined in PHP 7.1+.
* Correct the `$filename` parameter type in `wp_get_webp_info()`.
* Use a consistent message when skipping tests due to the lack of WebP support.
* Remove unnecessary `else` branches after `markTestSkipped()`.
* Replace `assertEquals()` with more appropriate assertions.

Follow-up to [50810].

See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50814 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-05 17:06:17 +00:00
Sergey Biryukov
596a24c692 Themes: Remove the "Featured" tab on Add Themes screen.
Themes displayed in this tab were actually random, and have not been selected to be featured to new WordPress users.

The tab had already been removed from the Theme Directory, and with this change, the options in the admin area and in the directory will match again.

The "Popular" tab is now displayed instead as the default view.

Props poena, kjellr, celloexpressions.
Fixes #49487. See #meta5044.

git-svn-id: https://develop.svn.wordpress.org/trunk@50813 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-05 15:53:41 +00:00
Jonathan Desrosiers
aa62fdbfaa Formatting: Verify emails with + characters are valid.
This adds an assertion to confirm that `is_email()` considers email addresses with a `+` valid.

Props SergeyBiryukov, ayeshrajans.
Fixes #53130.

git-svn-id: https://develop.svn.wordpress.org/trunk@50812 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 16:05:49 +00:00
Sergey Biryukov
9aa08906e2 Docs: Further synchronize documentation for some Plugin API functions.
Follow-up to [50807].

See #50531.

git-svn-id: https://develop.svn.wordpress.org/trunk@50811 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 15:00:33 +00:00
Adam Silverstein
6a5ff5aa03 Images: enable WebP support.
Add support for uploading, editing and saving WebP images when supported by the server.

Add 'image/webp' to supported mime types. Correctly identify WebP images and sizes even when PHP doesn't support WebP. Resize uploaded WebP files (when supported) and use for front end markup.

Props markoheijne, blobfolio, Clorith, joemcgill, atjn, desrosj, spacedmonkey, marylauc, mikeschroder, hellofromtonya, flixos90.
Fixes #35725.



git-svn-id: https://develop.svn.wordpress.org/trunk@50810 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 14:43:36 +00:00
Jonathan Desrosiers
80302b7b35 General: Use correct escaping function for form action attributes.
Props chintan1896, audrasjb.
Fixes #53150.

git-svn-id: https://develop.svn.wordpress.org/trunk@50809 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 13:46:06 +00:00
Jonathan Desrosiers
3eb51f7546 General: Use correct escaping function for the plugin icon URL.
Props chintan1896, audrasjb.
Fixes #53151.

git-svn-id: https://develop.svn.wordpress.org/trunk@50808 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 13:37:50 +00:00
Sergey Biryukov
96c9af127c Plugins: Standardize the terminology used for actions, filters, and callback functions.
Use `$hook_name` when referring to a filter or action hook name, and `$callback` when referring to a callback function.

This brings more consistency to parameter names in Plugin API functions.

Includes minor code layout fixes for better readability and reordering some functions in a more logical order.

Props johnbillion, jrf, SergeyBiryukov.
Fixes #50531.

git-svn-id: https://develop.svn.wordpress.org/trunk@50807 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-04 10:46:26 +00:00
Sergey Biryukov
86d09a09a4 Twenty Twenty-One: Fix "Opening PHP tag must be on a line by itself" WPCS issue.
Follow-up to [50802].

See #52938.

git-svn-id: https://develop.svn.wordpress.org/trunk@50806 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-03 14:33:21 +00:00
Sergey Biryukov
65fb405e87 Coding Standards: Fix a whitespace at end of line issue in wp-admin/includes/class-wp-comments-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50805 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-03 14:08:13 +00:00
Sergey Biryukov
1415ac7ca7 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-posts-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50804 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-03 13:55:08 +00:00
Sergey Biryukov
984c194bf2 Upgrade/Install: Display plugin and theme update counts on WordPress Updates screen.
This restores the information that was previously included in a title attribute tooltip on pending updates link in the toolbar.

Follow-up to [50801].

Props sabernhardt, audrasjb, mukesh27, davidbaumwald.
Fixes #53031.

git-svn-id: https://develop.svn.wordpress.org/trunk@50803 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-02 16:52:46 +00:00
Sergey Biryukov
955df634d1 Twenty Twenty-One: Display page title as the H1 heading when a static page is selected as the "Posts page".
This ensures that the heading represents the content of the page. Previously, the site title was displayed instead.

Props sabernhardt, justinahinon, rianrietveld, mukesh27, francina, audrasjb, Boniu91.
Fixes #52938.

git-svn-id: https://develop.svn.wordpress.org/trunk@50802 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-01 18:12:22 +00:00
Joe Dolson
6ba7c6e93d Toolbar: Remove title attribute on pending updates link.
Remove the title attribute from the link, wrap the link icon and numeric indicator with the `aria-hidden` attribute, and add a `.screen-reader-text` span so screen readers hear a link that has relevant context without requiring translators to deal with appended strings. Removes the individual counts of theme and plugin updates from the attribute, as those were already buggy and didn't include translation counts.

Props afercia, Mte90, sabernhardt, audrasjb
Fixes #26562. See #53031.

git-svn-id: https://develop.svn.wordpress.org/trunk@50801 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-30 22:53:02 +00:00
Sergey Biryukov
54a3773623 External Libraries: Upgrade PHPMailer to version 6.4.1.
Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.4.1

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.4.0...v6.4.1

Props ayeshrajans.
Fixes #53114.

git-svn-id: https://develop.svn.wordpress.org/trunk@50799 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-29 20:29:00 +00:00
Greg Ziółkowski
f826a6a858 Editor: Fix typo in image default size setting
Related change in Gutneberg: https://github.com/WordPress/gutenberg/pull/31324

Props mamaduka.
See #52920.



git-svn-id: https://develop.svn.wordpress.org/trunk@50798 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-29 10:10:38 +00:00
David Baumwald
13bb1a0959 Coding Standards: Update $out in WP_Widget_Pages with a more meaningful name.
Rename an `$out` variable to `$output` for consistency with other widget classes..

Props mukesh27.
Fixes #53059.

git-svn-id: https://develop.svn.wordpress.org/trunk@50797 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-28 20:53:10 +00:00
Jonathan Desrosiers
bcd65037b6 Build/Test Tools: Correctly test grunt clean when built to run from src.
Because the `--` separator was missing, the `--dev` flag was not being passed to the script, thus not testing properly.

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50796 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-28 19:05:58 +00:00
Sergey Biryukov
a8323bf8e7 Coding Standards: Fix a precision alignment issue in wp-admin/includes/template.php.
Follow-up to [49223].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50795 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-28 18:53:04 +00:00
Riad Benguella
ce50c6a982 Block Editor: Update the bundled block patterns.
This updates the block patterns included by default on WordPress
to give them more personality and to make use of the design tools
that has been added to the editor.

Props onemaggie, melchoyce, kjellr, beafialho, gziolo.
Fixes #52846.


git-svn-id: https://develop.svn.wordpress.org/trunk@50794 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-28 10:36:40 +00:00
Sergey Biryukov
30ff995eb0 REST API: Check the results of get_metadata() in WP_REST_Meta_Fields methods.
This avoids PHP warnings in case the function returns boolean `false` instead of an array.

Props david.binda.
Fixes #53099.

git-svn-id: https://develop.svn.wordpress.org/trunk@50793 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-27 18:34:52 +00:00
Sergey Biryukov
334ef09078 Docs: Document the usage of $current_user global in get_user_by().
Follow-up to [50790].

Props paaggeli, mukesh27.
Fixes #53088.

git-svn-id: https://develop.svn.wordpress.org/trunk@50792 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-27 17:47:39 +00:00
Sergey Biryukov
7e1690bf87 Posts, Post Types: Pass the post object to the_password_form filter.
Props silb3r.
Fixes #29008.

git-svn-id: https://develop.svn.wordpress.org/trunk@50791 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-26 15:36:55 +00:00
Peter Wilson
ecd93af74a Users: Share current user instance across functions.
Share the `WP_User` instance for the current user between the functions `get_userdata()` and `wp_get_current_user()`. Both functions return the `$current_user` global for the current user.

Force refresh the `$current_user` global within `clean_user_cache()` by immediately re-calling `wp_set_current_user()` with the current user's ID. This ensures any changes to the current user's permissions or other settings are reflected in the global. As a side-effect this immediately rewarms the current user's cache.

Props chaion07, chriscct7, donmhico, hellofromtonya, lukecarbis, peterwilsoncc, rmccue, TimothyBlynJacobs.
Fixes #28020.


git-svn-id: https://develop.svn.wordpress.org/trunk@50790 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-26 01:02:34 +00:00
Peter Wilson
c44e1d6fe4 Build/Tests tools: Improve get_bookmark() test coverage.
Props hellofromtonya, peterwilsoncc.
See #52988.


git-svn-id: https://develop.svn.wordpress.org/trunk@50789 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-26 00:58:14 +00:00
Sergey Biryukov
32ca843154 Plugins: When loading a plugin in a "sandbox" on activation, do it once.
This avoids a fatal error if the plugin is already included, e.g. in unit tests.

Follow-up to [50787].

See #31104.

git-svn-id: https://develop.svn.wordpress.org/trunk@50788 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-25 13:19:54 +00:00
Sergey Biryukov
93290c44f6 Plugins: When loading a plugin in a "sandbox" on activation, do it in a separate function.
This avoids accidentally overriding some variables in the scope of `activate_plugin()`, e.g. `$silent` or `$network_wide`.

Plugins expecting to have access to `$network_wide` directly on inclusion should receive it as an argument of the activation hook callback instead, on any of these actions:

* `activate_plugin`
* `activate_{$plugin}`
* `activated_plugin`

Follow-up to [28644].

Props Mike_Cowobo, dd32, DrewAPicture, mensmaximus, SergeyBiryukov.
Fixes #31104.

git-svn-id: https://develop.svn.wordpress.org/trunk@50787 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-24 18:02:39 +00:00
Aaron Jorbin
1661c1a1e7 Bootstrap/Load: Add Function for reliable timing data
Adds timer_float which can be used to get the time elapsed so far during the PHP script. Should make it easier to display the page generation time in the footer of admin.

WordPress should expose timing data as a float in the most accurate manner possible. timer_stop() has two problems: it uses an initial timestamp generated later than it needs to be and its formatted return value can not reliably be used as a number (some locales swap commas and periods, for example).

Props andy, matt, jorbin.
Fixes #39163.



git-svn-id: https://develop.svn.wordpress.org/trunk@50786 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-23 19:47:43 +00:00
Sergey Biryukov
edd6ec0389 Coding Standards: Use strict comparison in wp-admin/includes/update-core.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50785 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-23 14:49:51 +00:00
Jonathan Desrosiers
e4bda140d4 Build/Test Tools: Remove Internet Explorer 11 from the browserslist.
This officially removes support for Internet Explorer 11 in the CSS files run through the build process in Core.

Individual tickets should be opened for removing each manually maintained area of the code base targeting IE11.

The resulting changes to CSS files are included in this commit.

Fixes #53077.

git-svn-id: https://develop.svn.wordpress.org/trunk@50784 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-22 22:56:40 +00:00
Sergey Biryukov
2464d69d8d Coding Standards: Remove loose comparison in wp-admin/includes/plugin-install.php.
This more closely represents how the active installations count is displayed in the Plugin Directory.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50783 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-22 19:16:42 +00:00
Jonathan Desrosiers
f1466b8b73 Build/Test Tools: Update the caniuse-lite database.
This updates the `caniuse-lite` database to the most recent version (`1.0.30001214`) by running `npx browserslist@latest --update-db`.

The resulting changes after running `grunt precommit:css` are also included in this commit.

See #52624.

git-svn-id: https://develop.svn.wordpress.org/trunk@50782 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-22 00:54:44 +00:00
Sergey Biryukov
63f52a63f1 Docs: Add a @since note to wp_mail() about using is_email() for validation.
Follow-up to [48645].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50781 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 19:45:26 +00:00
Sergey Biryukov
5aae96ba8b Coding Standards: Use strict comparison in wp-admin/includes/class-wp-terms-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50780 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 18:51:33 +00:00
David Baumwald
c687dc182b Coding Standards: Fix minor, inline spacing issue in wp-admin/setup-config.php.
See #52627.




git-svn-id: https://develop.svn.wordpress.org/trunk@50779 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 18:29:58 +00:00
David Baumwald
16a16fd556 External Libraries: Update Underscore to version 1.13.1.
A full set of changes can be found on GitHub: https://github.com/jashkenas/underscore/compare/1.12.1...1.13.1.

Follow-up to [50650].

Props hareesh-pillai.
See #45785.

git-svn-id: https://develop.svn.wordpress.org/trunk@50778 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 17:53:21 +00:00
Greg Ziółkowski
4ac39957a2 Editor: Shape block editor filters to work better with the Gutenberg plugin
This should allow to use new filters in the Gutenberg plugin and therefore it prevents deprecation warnings when in the debug mode.

See #52920.



git-svn-id: https://develop.svn.wordpress.org/trunk@50777 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 09:30:40 +00:00
Greg Ziółkowski
a19f589a5f Editor: Abstract block editor configuration
There are several WordPress hooks defined on the server that depend on $post object that isn’t present on the new screens like edit site, edit widgets, or edit navigation. This patch deprecates existing filters and introduces replacements that are context-aware.

Props azaozz, andraganescu, jeremyfelt, nosolosw, youknowriad.
See #52920.





git-svn-id: https://develop.svn.wordpress.org/trunk@50776 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 05:10:56 +00:00
Peter Wilson
bf637356a2 Upgrade/Install: Prevent possible type errors during installation.
Prevent a `TypeError` from occurring during installation if `wp-config.php` is not writable. In PHP 8.0 this can cause a fatal error, in earlier versions of PHP a warning would be thrown.

Account for a change in type returned by `fopen()` coming in a future version of PHP. Minor coding standards fixes in the `/wp-admin/setup-config.php` file.

Props xknown, hellofromTonya, jrf, peterwilsoncc.
See #51423.



git-svn-id: https://develop.svn.wordpress.org/trunk@50775 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 01:31:45 +00:00
Jonathan Desrosiers
87550a9e21 Build/Test Tools: Update several dependencies.
This updates the following dependencies:

- `cssnano` from version `4.1.10` to `4.1.11`.
- `grunt-webpack` from `4.0.2` to `4.0.3`.
- `qunit` from `12.14.1` to `12.15.0`.
- `sass` from `1.32.8` to `1.32.11`.
- `uglify-js` from `3.13.3` to `3.13.4`.

See #52624.

git-svn-id: https://develop.svn.wordpress.org/trunk@50774 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-20 20:00:16 +00:00
Jonathan Desrosiers
205611fd64 External Libraries: Update Moment.js to the latest version.
This updates the `moment` script from version `2.27.0` to `2.29.1`.

Props shital-patel, hareesh-pillai.
Fixes #52853.

git-svn-id: https://develop.svn.wordpress.org/trunk@50773 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-20 19:13:53 +00:00