Commit Graph

46041 Commits

Author SHA1 Message Date
Jb Audras
00a2b65eee Docs: Various docblock improvements in Export Administration API, as per docs standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53792 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-29 08:12:27 +00:00
Peter Wilson
a091693f9a Cron API: Modify _get_cron_array() to always return an array.
Change the return type of `_get_cron_array()` to an empty array if the `cron` option is either missing or of an 
unexpected type.

This change ensures the return value for no registered events is consistently an empty array. Previously the return 
value could be either an empty array or `false`.

Props thakkarhardik, jrf, costdev.
Fixes #53940.


git-svn-id: https://develop.svn.wordpress.org/trunk@53791 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-29 03:32:58 +00:00
Sergey Biryukov
7b43b08dd5 Tests: Simplify some assertions in Tests_Media.
A number of assertions are checking for the number of times a hard-coded substring existed in a larger `$haystack`.

These assertions were using `preg_match_all()` to do so, but without actually using a regex.

In these cases, it is more performant (and simpler) to use the PHP native `substr_count()` function, which will yield the same result, without the overhead of regex parsing.

Reference: [https://www.php.net/manual/en/function.substr-count.php PHP Manual: substr_count()]

Follow-up to [711/tests], [38838], [42694], [53558].

Props jrf.
See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53790 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-28 22:37:00 +00:00
Sergey Biryukov
9f5935c2e8 Tests: Use named data providers in some wp_insert_post() tests.
Follow-up to [42380], [49125], [53521], [53785], [53787], [53788].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53789 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-27 16:27:18 +00:00
Sergey Biryukov
5e2861c92d Tests: Don't unnecessarily randomize the post type in some wp_insert_post() tests.
Follow-up to [33041], [52389], [53785], [53787].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53788 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-27 16:07:20 +00:00
Sergey Biryukov
c52486b995 Tests: Don't unnecessarily set the author in some wp_insert_post() tests.
This aims to make the tests more specific. Setting the author appears to be redundant, as the as the authorship is out of scope for these particular tests.

Follow-up to [66/tests], [84/tests], [167/tests], [296/tests], [412/tests], [496/tests], [1026/tests], [1323/tests], [25554], [33041], [34762], [35183].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53787 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-27 15:41:30 +00:00
Felix Arntz
a9c64ad629 Media: Add information about additional MIME type sources to attachments REST endpoints.
This changeset is a follow-up to [53751] which ensures the additional `sources` information stored in attachment metadata are available under `media_details` for each image size in the REST API responses for attachments.

Props mukesh27, eugenemanuilov, mitogh, flixos90, aaemnnosttv.
See #55443.


git-svn-id: https://develop.svn.wordpress.org/trunk@53786 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-27 15:13:16 +00:00
Sergey Biryukov
09808ef048 Tests: Move wp_insert_post() tests to their own file.
Now that there is a separate test class for `wp_insert_post()` tests, some of the pre-existing tests from the general `Tests_Post` class can be moved there.

Includes:
* Removal of unnecessarily setting the current user to Editor for all tests.
* Removal of unnecessarily setting the cron option to an empty array for all tests.

Follow-up to [496/tests], [36607], [53782], [53783].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53785 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-27 14:59:12 +00:00
Greg Ziółkowski
52f51f5cdf Site Editor: Pass correct context into get_block_categories
Site Editor passed incorrectly global $post as a context when setting up block categories. Instead, it should pass $block_editor_context, since global $post is null in this file.

Props Mamaduka.
Fixes #56284.



git-svn-id: https://develop.svn.wordpress.org/trunk@53784 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-27 12:25:06 +00:00
Sergey Biryukov
d5fe7bcf45 Tests: Move wp_publish_post() tests to their own file.
Now that there is a separate test class for `wp_publish_post()` tests, some of the pre-existing tests from the general `Tests_Post` class can be moved there.

Follow-up to [1039/tests], [1174/tests], [46969], [49000].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53783 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-26 14:28:57 +00:00
Sergey Biryukov
13e664a412 Tests: Bring some modernization to wp_insert_post() tests.
Includes:
* Using `assertIsInt()` instead of `assertIsNumeric()` for post IDs.
* Using consistent variable names for post data and retrieved posts.
* Removing added filters before performing assertions, not after.
* Removing unused `Tests_Post::$post_ids` property.
* Correcting the order of arguments in some assertions.
* Converting some `foreach()` loops to data providers.
* Wrapping long lines for better readability.

Follow-up to [13/tests], [14/tests], [167/tests], [496/tests], [1174/tests], [1246/tests], [1287/tests], [1307/tests], [1326/tests], [30510], [33261], [33630], [34762], [46279], [50012], [51438].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53782 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-26 13:53:19 +00:00
Jb Audras
4ec275f552 Taxonomy: Allow filtering Ajax term search results in quick edit.
This changeset introduces the `ajax_term_search_results` hook which can be used to filter the term search results returned by the AJAX term query.

Props grandeljay, costdev, ironprogrammer, audrasjb, SergeyBiryukov.
Fixes #55606.


git-svn-id: https://develop.svn.wordpress.org/trunk@53781 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-26 13:21:55 +00:00
Jb Audras
1d020c1012 Docs: Improve parameter descriptions in render_block and render_block_* filters.
The former `$block_content` parameter descriptions were too opinionated as block content can be appended, prepended, nested, removed, etc.

Props milana_cap.
Fixes #56286.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53780 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-26 12:58:11 +00:00
Sergey Biryukov
c3ff3dbfc4 Revisions: Update the "last revision" wording to "latest revision" in various files.
This aims to reduce ambiguity about what exactly is the "first" or "last" revision, and bring more consistency with similar wording elsewhere in core, e.g. latest posts, latest comments, etc.

This affects:
* `wp_save_post_revision()`
* `wp_prepare_revisions_for_js()`
* `WP_Customize_Manager::filter_revision_post_has_changed()`

Follow-up to [53759], [53769], [53778].

Props peterwilsoncc.
Fixes #55857.

git-svn-id: https://develop.svn.wordpress.org/trunk@53779 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 19:28:29 +00:00
Sergey Biryukov
ce154a4b66 Revisions: Rename the function for retrieving the latest revision ID and total count.
The new name is `wp_get_latest_revision_id_and_total_count()`.

This aims to reduce ambiguity about what exactly is the "first" or "last" revision, and bring more consistency with similar wording elsewhere in core, e.g. latest posts, latest comments, etc.

Follow-up to [53759], [53769].

Props peterwilsoncc.
See #55857.

git-svn-id: https://develop.svn.wordpress.org/trunk@53778 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 19:18:41 +00:00
Jb Audras
e5bd74cad8 Media: Prevent URLs from overflowing their container in the media editor.
This changeset also introduces the `.word-wrap-break-word` class which can be used to apply `word-wrap: break-word` to admin elements when needed.

Props mitogh, costdev, kapilpaul, alamgircsebd, sabernhardt, anantajitjg, afercia, circlecube, SergeyBiryukov, rafiahmedd, audrasjb.
Fixes #55393.


git-svn-id: https://develop.svn.wordpress.org/trunk@53777 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 18:09:26 +00:00
Jb Audras
0d7487bad9 Docs: Remove an obsolete function description in addslashes_gpc().
- Usage of `get_magic_quotes_gpc()` was removed from `addslashes_gpc()` in [46105] / #47783.
- A similar description fragment was removed from `wp_parse_str()` in that changeset, but this one was missed.
- The `get_magic_quotes_gpc()` function itself was deprecated in PHP 7.4 and removed in PHP 8.0.

Props mitweka, audrasjb, SergeyBiryukov.
Fixes #56233.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53776 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 17:26:24 +00:00
Jb Audras
730a15cf3c Docs: Refine @return docblock mentions for esc_sql(), wp_slash() and wp_unslash().
Props malthert, SergeyBiryukov, johnbillion, desrosj, byohann6.
Fixes #53946.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53775 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 15:41:10 +00:00
Sergey Biryukov
36fcd57c91 Tests: Declare custom-logo theme support for custom logo tests.
This addresses failures in `has_custom_logo()` and `get_custom_logo()` tests when being run separately:
{{{
1) Tests_General_Template::test_has_custom_logo
Custom logo should not be set after removal.
Failed asserting that true is false.
tests/phpunit/tests/general/template.php:291

2) Tests_General_Template::test_get_custom_logo
Custom logo should not be set after removal.
Failed asserting that a string is empty.
tests/phpunit/tests/general/template.php:336
}}}

Specifically, this ensures that the `site_logo` option gets deleted in `_delete_site_logo_on_remove_theme_mods()`, which in turn prevents the `core/site-logo` block filters from affecting the custom logo tests.

Alternatively, these filters could be removed instead:
{{{
remove_filter( 'theme_mod_custom_logo', '_override_custom_logo_theme_mod' );
remove_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
}}}

Follow-up to [36905], [51091], [51421], [52042].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53774 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 13:46:23 +00:00
Sergey Biryukov
4ed912c8c3 Tests: Add failure messages for site icon and custom logo tests.
This makes the assertions more helpful, as per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#using-assertions Writing PHP Tests] guidelines:
> All PHPUnit assertions, as well as all WordPress custom assertions, allow for a `$message` parameter to be passed. This message will be displayed when the assertion fails and can help immensely when debugging a test. This parameter should always be used if more than one assertion is used in a test method.

Follow-up to [33181], [36905].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53773 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 13:31:24 +00:00
Peter Wilson
c1cf07e4e3 REST API: Prime post caches in comments endpoint.
Prevent each call to `get_post()` triggering a seperate database query by priming the cache of each comment's post in 
the REST API's comments endpoint.

Props spacedmonkey, timothyblynjacobs.
Fixes #56272.



git-svn-id: https://develop.svn.wordpress.org/trunk@53772 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-25 02:51:29 +00:00
Sergey Biryukov
6cbed78c94 Posts, Post Types: Check if the post type exists in wp_insert_post().
This avoids an `Attempt to read property "cap" on null` PHP warning when checking an unregistered post type's `publish_posts` capability to disallow contributors setting the post slug for pending posts.

Follow-up to [9055], [42380].

Props Chouby, mukesh27, rafiahmedd, SergeyBiryukov.
Fixes #55877.

git-svn-id: https://develop.svn.wordpress.org/trunk@53771 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-24 13:24:44 +00:00
Sergey Biryukov
e2a45c0d8a Docs: List the expected type first in a few functions:
* `is_allowed_http_origin()`
* `doing_filter()`
* `wp_get_post_revisions_url()`

Follow-up to [28010], [28889], [30674], [46696], [47060], [48068], [49929], [49963], [52095], [51286], [52111].

See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53770 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-23 16:55:18 +00:00
Sergey Biryukov
7e8feefd44 Revisions: Correct the function name for retrieving the last revision ID and total count.
Includes:
* Renaming the function to `wp_get_last_revision_id_and_total_count()`.
* Making the default value for `$post` consistent with `wp_get_post_revisions()`.
* Making `WP_Error` codes more specific and using them in test assertions.
* Adjusting the function description per the documentation standards.

Follow-up to [53759].

Props JustinSainton, SergeyBiryukov.
See #55857.

git-svn-id: https://develop.svn.wordpress.org/trunk@53769 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-23 15:40:10 +00:00
Sergey Biryukov
a560641179 Docs: Document that the $file_format parameter of metadata filters can be null.
This affects the `wp_read_video_metadata` and `wp_read_audio_metadata` filters.

Follow-up to [41746], [53764].

See #55646, #55828.

git-svn-id: https://develop.svn.wordpress.org/trunk@53768 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-23 15:04:03 +00:00
Sergey Biryukov
c937a1a305 Cache API: Make the placement of wp_cache_flush_group() more consistent.
Includes:
* Placing `WP_Object_Cache::flush_group()` next to `::flush()`.
* Placing `wp_cache_supports_group_flush()` next to `wp_cache_flush_group()`.
* Placing the `wp_cache_flush_group()` unit test next to the `::flush()` method test.
* Removing test name from assertion messages, as it is already mentioned directly above in case of failure.
* Adjusting function descriptions per the documentation standards.

Follow-up to [52706], [53763].

See #55647, #4476.

git-svn-id: https://develop.svn.wordpress.org/trunk@53767 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-23 14:56:51 +00:00
Jb Audras
f0ddd2e2c2 Docs: Add function description and @since mention for get_upload_iframe_src().
Follow-up to [14015].

See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53766 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-23 08:58:42 +00:00
Jb Audras
6db7bb8dcf Docs: Fix indentation issues in wp_read_video_metadata and wp_read_audio_metadata docblocks.
Follow-up to [53764].

See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53765 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-23 08:17:08 +00:00
Jb Audras
ce00971ca1 Media: Allow filtering audio file metadata in wp_read_audio_metadata().
This changeset introduces the `wp_read_audio_metadata` hook which allows to filter metadata extracted from an uploaded audio file.

This brings consistency with corresponding filters available for image and video file types:

- `wp_read_image_metadata` added in [6313] / #5162.
- `wp_read_video_metadata` added in [41746] / #35218.

Props luigipulcini, SergeyBiryukov, mukesh27.
Fixes #55828.


git-svn-id: https://develop.svn.wordpress.org/trunk@53764 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-23 08:11:51 +00:00
Jonny Harris
40768e4ebe Cache API: Add wp_cache_flush_group function.
Add a new plugable function called `wp_cache_flush_group`, that will allow developers to clear whole cache groups with a single call. Developers can detect if their current implementation of an object cache supports flushing by group, by calling `wp_cache_supports_group_flush` which returns true if it is supported. If the developers of the object cache drop-in has not implemented `wp_cache_flush_group` and `wp_cache_supports_group_flush`, these functions are polyfilled and `wp_cache_supports_group_flush` defaults to false.

Props Spacedmonkey, filosofo, ryan, sc0ttkclark, SergeyBiryukov, scribu, Ste_95, dd32, dhilditch, dougal, lucasbustamante, dg12345, tillkruess, peterwilsoncc, flixos90, pbearne.
Fixes #4476.

git-svn-id: https://develop.svn.wordpress.org/trunk@53763 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 20:50:31 +00:00
Jonathan Desrosiers
bd151a9048 Bundled Themes: Update NPM dependencies for Twenty Twenty and Twenty Nineteen.
There are no changes to any built files after updating.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53762 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 17:09:05 +00:00
Jonathan Desrosiers
f3339e91be Twenty Twenty-One: Update NPM dependencies.
This updates the NPM dependencies for the Twenty Twenty-One theme to the latest versions.

Modifications to the built files are included in this commit, which are a result of updating the `sass` dependency to the latest version.

Previously, trailing loud comments (`/* ... */`) were pushed to the next line,. Now the comment location is preserved, resulting in the built CSS files more closely resembling the theme’s SCSS files.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53761 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 16:40:50 +00:00
Jonny Harris
b7bae6936a REST API: Avoid unnecessarily preparing item links.
Do not call the `prepare_links` methods in core REST API controllers, unless the `_links` or `_embedded` fields are requested. There is no need to prepare links if they are never returned in the response. This saves resources, as many calls to `prepare_links` methods perform database queries. 

Props Spacedmonkey, timothyblynjacobs, rachelbaker, desrosj, dlh, hellofromTonya.
Fixes #52992.

git-svn-id: https://develop.svn.wordpress.org/trunk@53760 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 13:58:46 +00:00
Jonny Harris
3506684f2a REST API: Use wp_get_lastest_revision_id_and_total_count function in WP_REST_Posts_Controller class.
Add new function called `wp_get_lastest_revision_id_and_total_count`, that performs an optimized query to get the last revision and total and use it in `WP_REST_Posts_Controller` class. 

Props Spacedmonkey, timothyblynjacobs, furi3r, peterwilsoncc.
Fixes #55857.

git-svn-id: https://develop.svn.wordpress.org/trunk@53759 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 13:22:04 +00:00
Sergey Biryukov
e822a9a209 Administration: Correct the escaping in documentation lookup for plugin and theme editor.
This brings consistency to similar code fragments that evolved in slightly different ways over the years:

* A check that the list of functions is not empty now exists in both editors.
* "Function Name..." is an option label, not an attribute, so `esc_html__()` is the correct function here.
* `esc_attr( urlencode( $function ) )` in the theme editor is replaced with `esc_attr( $function )`.
* `htmlspecialchars( $function )` in the theme editor is replaced with `esc_html( $function )`.

Follow-up to [10607], [10879], [11110], [11173], [11204], [11671], [14989].

Props aristath, justinahinon, poena, audrasjb, pratiweb, SergeyBiryukov.
Fixes #56007.

git-svn-id: https://develop.svn.wordpress.org/trunk@53758 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 11:31:27 +00:00
Jb Audras
b3b2758455 Docs: Provide a more accurate description for wp_is_theme_directory_ignored().
This function doesn't filter theme directories, it rather determines whether a directory should be ignored during export.

Props audrasjb, nareshbheda.
Fixes #56257.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53757 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-22 07:16:27 +00:00
Sergey Biryukov
334c3ca59d Coding Standards: Use __DIR__ instead of ABSPATH in wp-db.php.
If the file is included directly outside of WordPress core, `ABSPATH` may not be defined.

Follow-up to [53749], [53750], [53755].

See #56268, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53756 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 22:43:24 +00:00
Sergey Biryukov
1bcb9808c9 Coding Standards: Check if the _deprecated_file() function exists in wp-db.php.
This avoids a fatal error if the file is included directly outside of WordPress core, e.g. by HyperDB.

Additionally, replace `WPINC` with `wp-includes`, as the constant may not be defined yet in that context.

Follow-up to [53749], [53750].

See #56268, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53755 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 21:37:03 +00:00
Jb Audras
1d5d9e24c4 Formatting: Normalize to Unicode NFC encoding before converting accent characters in remove_accents().
This changeset adds Unicode sequence normalization from NFD to NFC, via the `normalizer_normalize()` PHP function which is available with the recommended `intl` PHP extension.

This fixes an issue where NFD characters were not properly sanitized. It also provides a unit test for NFD sequences (alternate Unicode representations of the same characters).

Props NumidWasNotAvailable, targz, nacin, nunomorgadinho, p_enrique, gitlost, SergeyBiryukov, markoheijnen, mikeschroder, ocean90, pento, helen, rodrigosevero, zodiac1978, ironprogrammer, audrasjb, azaozz, laboiteare, nuryko, virgar, dxd5001, onnimonni, johnbillion.
Fixes #24661, #47763, #35951.
See #30130, #52654.


git-svn-id: https://develop.svn.wordpress.org/trunk@53754 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 21:09:56 +00:00
Adam Silverstein
ae757491f5 Upgrade/Install: track php extensions and image library support for WebP and AVIF.
Add the loaded php extensions as well as whether the server's image libraries support WebP and AVIF image formats to the data payload sent during upgrade checks. Collecting this data with the WordPress.org API will help the project make more data driven decisions about feature support. Note that all data can still be filtered with the `core_version_check_query_args` filter for privacy reasons.

Props dd32, SergeyBiryukov, mikeschroder, pbiron. 
Fixes #48116.



git-svn-id: https://develop.svn.wordpress.org/trunk@53753 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 20:20:52 +00:00
Jb Audras
e25668d086 Application Passwords: Link a more accurate documentation page in User profile edit screen.
This changeset replaces a HelpHub link with more accurate DevHub link about environment types in User profile edit screen.

Props greg24, whaze.
Fixes #56267.


git-svn-id: https://develop.svn.wordpress.org/trunk@53752 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 19:30:21 +00:00
Adam Silverstein
9bbf3985e3 Media: enable generating multiple mime types for image uploads; specifically WebP versions for JPEG images by default.
This changeset adds the capability for core media uploads to generate sub sized images in more than a single mime type. The output formats for each mime type can be controlled through a filter. WebP is used as an additional output format for JPEG images by default to improve front end performance.

When generating additional mime types, only images which are smaller than the respective original are retained. By default, additional mime type images are only generated for the built-in core image sizes and any custom sizes that have opted in.

Image meta is updated with a new 'sources' array containing file details for each mime type. Each image size in the 'sizes' array also gets a new 'sources' array that contains the image file details for each mime type.

This change also increases image upload retries to accommodate additional image sizes. It also adds a `$mime_type` parameter to the `wp_get_missing_image_subsizes` function and filter.

This change adds three new filters to enable full control of secondary mime image generation and output:

* A new filter `wp_image_sizes_with_additional_mime_type_support` that filters the sizes that support secondary mime type output. Developers can use this to control the output of additional mime type sub-sized images on a per size basis.
* A new filter `wp_upload_image_mime_transforms` that filters the output mime types for a given input mime type. Developers can use this to control generation of additional mime types for a given input mime type or even override the original mime type.
* A new filter `wp_content_image_mimes` which controls image mime type output selection and order for frontend content. Developers can use this to control the mime type output preference order for content images. Content images inserted from the media library will use the available image versions based on the order from this filter.

Thanks to the many contributors who helped develop, test and give feedback on this feature.

A haiku to summarize:

Upload a JPEG
Images of all sizes
Output as WebPs

Props flixos90, MatthiasReinholz, studiolxv, markhowellsmead, eatingrules, pbiron, mukesh27, joegrainger, mehulkaklotar, tweetythierry, akshitsethi, peterwilsoncc, eugenemanuilov, mitogh, shetheliving, clarkeemily, codekraft, mikeschroder, clorith, kasparsd, spacedmonkey, trevorpfromsandee, jb510, scofennellgmailcom, seedsca, cagsmith, karinclimber, dainemawer, baxbridge, grapplerulrich, sobatkras, chynnabenton, tonylocalword, barneydavey, kwillmorth, garymatthews919, olliejones, imarkinteractive, jeffpaul, feastdesignco, webbeetle, masteradhoc.

See #55443.



git-svn-id: https://develop.svn.wordpress.org/trunk@53751 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 18:01:01 +00:00
Sergey Biryukov
0a9e88bafc Coding Standards: Replace the old wp-db.php filename in phpcompat.xml.dist.
This ensures the correct file is allowlisted for use of `mysql_` extension in PHP < 7.0.

Follow-up to [53749].

See #56268, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53750 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 16:07:15 +00:00
Sergey Biryukov
fdb6e13fed Coding Standards: Move wp-includes/wp-db.php to wp-includes/class-wpdb.php.
This renames the file containing the `wpdb` class to conform to the coding standards.

This commit also includes:
* A new `wp-db.php` that loads the new file, for anyone that may have been including the file directly.
* Replacing references to the old filename with the new filename.

Fixes #56268. See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53749 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 15:58:51 +00:00
Jb Audras
b01c8f193b Docs: Update do_action() docblock code example.
This changeset fixes an issue with the code example provided: `do_action()` doesn't return any value.

Props leogermani, thakkarhardik.
Fixes #55977.


git-svn-id: https://develop.svn.wordpress.org/trunk@53748 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 14:30:21 +00:00
Sergey Biryukov
f98e99c8b6 Coding Standards: Adjust the logic slightly in wp_ajax_replyto_comment().
This aims to bring more consistency to the function logic by separating the comment content and type checks from the user existence check.

Follow-up to [8720], [9098], [29758].

See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53747 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 10:57:03 +00:00
Jb Audras
03f47814dd Docs: Add missing function description in wp-admin/includes/template.php.
This changeset also includes a few docblock standards fixes in the same file.

See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53746 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 09:22:22 +00:00
Jb Audras
bf61851c38 Administration: Add labels to read-only form fields.
This changeset improves admin forms accessibility by adding labels to the following read-only form fields:

- Network setup screen: new visible label to the four textareas for code users need to paste into their wp-config file and the server configuration file (web.config or .htaccess).
- `setup-config.php`: new visible label to one textarea for code to include in the `wp-config` file manually.
- Admin toolbar: adds an `arial-label` attribute to the old "shortlink" feature (not used anymore but still activable by plugins).

Props sabernhardt, audrasjb, ryokuhi, joedolson.
Fixes #54302.


git-svn-id: https://develop.svn.wordpress.org/trunk@53745 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 09:02:52 +00:00
Peter Wilson
3a20f3e4c5 Embeds: Add Pocket Casts as a trusted oEmbed provider.
Props mattwondra, peterwilsoncc, pento, audrasjb.
Fixes #55860.



git-svn-id: https://develop.svn.wordpress.org/trunk@53744 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 04:23:57 +00:00
Jb Audras
3c93ce881f Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/comment.php, as per docblocks standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53743 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-20 22:14:00 +00:00