45943 Commits

Author SHA1 Message Date
Jonathan Desrosiers
d75d6ca550 Build/Test Tools: Remove the workflow_run event from the Slack notification workflow.
The `workflow_run` event was added to restore Slack notifications for older branches (5.8 and older) without having to backport any changes while alternate approaches were explored.

The workflow has been tested and refined as a reusable one in `trunk`, and this approach is superior to the `workflow_run` event in several ways.

Primarily, the `workflow_run` event results in a separate workflow run being created for sending Slack notifications after the completion of each workflow triggered by `push`. When called as a reusable workflow, this does not happen and the additional jobs are instead added to the initial workflow. This makes which jobs are sending notifications for the current workflow more clear, and reduces the amount of noise (less workflow runs overall).

The `workflow_run` event also makes some data available in different ways than `push` events. By removing it, much of the logic within the workflow can be simplified.

See #56095.

git-svn-id: https://develop.svn.wordpress.org/trunk@53591 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-30 14:05:29 +00:00
Sergey Biryukov
f1b3ce0902 REST API: Use the integer type for page_on_front and page_for_posts options.
This adjusts the newly added options in the settings endpoint to use the `integer` type instead of `number`. Since these are page IDs and are not supposed to be floats, `integer` is the correct type.

Follow-up to [53588].

See #56058.

git-svn-id: https://develop.svn.wordpress.org/trunk@53589 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-29 14:15:57 +00:00
Sergey Biryukov
a0b53ac1db REST API: Add missing options to the settings endpoint.
This adds the `show_on_front`, `page_on_front`, and `page_for_posts` options to the settings endpoint that were missed during WP 6.0 backports.

Related PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/38607 #38607 Page for Posts: Display notice in template panel]

Props Mamaduka, spacedmonkey, gziolo, jameskoster.
See #56058.

git-svn-id: https://develop.svn.wordpress.org/trunk@53588 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-29 13:46:37 +00:00
Jb Audras
aaa4d1a4a7 Help/About: Typo correction in the Media Library help tab text.
Follow-up to [53586].

Props SergeyBiryukov.
Fixes #55800.


git-svn-id: https://develop.svn.wordpress.org/trunk@53587 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-29 13:37:38 +00:00
Jb Audras
0abc2b2a5b Help/About: Add help tab info for available row actions in the Media Library.
This changeset fills the existing help tab with more detailed information about available row actions in the Media Library, when using the List view.

Props kebbet, audrasjb, costdev, SergeyBiryukov, mukesh27.
Fixes #55800.


git-svn-id: https://develop.svn.wordpress.org/trunk@53586 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-28 20:45:28 +00:00
Jb Audras
44871d68a2 Docs: Misc fixes in Shortcode API function and hook descriptions, as per documentation standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53585 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-28 20:35:45 +00:00
Sergey Biryukov
911cc55368 Docs: Adjust some DocBlocks in wpdb per the documentation standards.
Includes:
* Wrapping long single-line comments to multi-line for better readability.
* Formatting code blocks to display correctly on the Code Reference.
* Other minor edits for consistency.

This applies to:
* `wpdb::$allow_unsafe_unquoted_parameters`
* `wpdb::escape_identifier()`
* `wpdb::_escape_identifier_value()`
* `wpdb::prepare()`
* `wpdb::has_cap()`

Follow-up to [53575].

See #52506, #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53584 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-28 11:25:21 +00:00
Jonathan Desrosiers
a5b555aac3 Build/Test Tools: Update the actions/cache action.
This correctly updates the `actions/cache` action. [53581] updated the inline comment to the latest version but did not update the actual SHA value correctly.

Follow up to [53581].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53582 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-27 19:23:45 +00:00
Jonathan Desrosiers
6d9ede9285 Build/Test Tools: Update 3rd party GitHub Actions.
This updates the following GitHub Actions to the latest versions:

- `actions/checkout`
- `actions/cache`
- `actions/github-script`
- `actions/setup-node`
- `codecov/codecov-action`
- `shivammathur/setup-php`
- `slackapi/slack-github-action`

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53581 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-27 18:57:00 +00:00
Jonathan Desrosiers
049b111254 Build/Test Tools: Update NPM devDependencies to their latest versions.
This updates the following `devDependencies` to newer versions:

- `dotenv` from `16.0.0` to `16.0.1`.
- `grunt` from `1.5.2` to `1.5.3`.
- `grunt-contrib-qunit` from `6.0.0` to `6.2.0`.
- `grunt-contrib-uglify` from `5.2.1` to `5.2.2`.
- `qunit` from `2.18.2` to `2.19.1`.
- `sass` from `1.51.0` to `1.53.0`.
- `sinon` from `13.0.2` to `14.0.0`.
- `uglify-js` from `3.15.4` to `3.16.1`.

Additionally, `npm audit fix` has been run to update dependencies with vulnerabilities.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53580 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-27 18:51:36 +00:00
Sergey Biryukov
b03466a79d General: Revert an earlier define of the WPINC constant in src/index.php.
This avoids a `Constant WPINC already defined in src/wp-settings.php on line 16` PHP warning, which happens when running a WordPress install out of the `src` directory after `npm run build:dev`.

Add a comment to clarify the check for built assets and the direct mention of `wp-includes`.

Follow-up to [53518].

Props aristath.
See #54233.

git-svn-id: https://develop.svn.wordpress.org/trunk@53579 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-27 10:18:44 +00:00
Sergey Biryukov
b6aabe46b7 Upgrade/Install: Add a conditional to facilitate testing of the Rollbacks feature project.
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] creates a temporary backup of plugins and themes before updating. This aims to make the update process more reliable and ensure that if a plugin or theme update fails, the previous version can be safely restored.

If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure plugin] is installed, `WP_Upgrader::install_package()` will use the `move_dir()` function from there for better performance. Instead of copying a directory from one location to another, it uses the `rename()` PHP function to speed up the process, which is instrumental in creating a temporary backup without a delay. If the renaming failed, it falls back to `copy_dir()` WP function.

This conditional aims to facilitate broader testing of the feature. It is temporary, until the plugin is merged into core.

Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf, SergeyBiryukov.
Fixes #56057. See #51857, #54166.

git-svn-id: https://develop.svn.wordpress.org/trunk@53578 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-26 12:35:28 +00:00
Sergey Biryukov
c558823416 Tests: Remove multiple $wpdb::placeholder_escape() calls in wpdb tests.
This aims to improve performance of the tests by reducing the number of function calls.

Since `$wpdb::placeholder_escape()` saves the result in a static variable on the first run, there is no need for repeated function calls during the same request or test run, as the result would still be the same.

Follow-up to [42056].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53577 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-25 14:43:27 +00:00
David Baumwald
2fa1194a75 Comments: Add contextual autocomplete attributes to comment form fields.
For accessibility, input fields should identify their "purpose".  The HTML5 attribute `autocomplete` allows for various user data to be quickly autofilled while adding context for some assistive technologies.

This commit adds the appropriate autofill purposes for an author's name, email, and website URL in the comment form template.

Props juliemoynat, bhrugesh96, sabernhardt.
Fixes #55779.

git-svn-id: https://develop.svn.wordpress.org/trunk@53576 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 21:24:18 +00:00
David Baumwald
ac64f38b66 Database: Add %i placeholder support to $wpdb->prepare to escape table and column names.
WordPress does not currently provide an explicit method for escaping SQL table and column names. This leads to potential security vulnerabilities, and makes reviewing code for security unnecessarily difficult.  Also, static analysis tools also flag the queries as having unescaped SQL input.

Tables and column names in queries are usually in-the-raw, since using the existing `%s` will straight quote the value, making the query invalid.

This change introduces a new `%i` placeholder in `$wpdb->prepare` to properly quote table and column names using backticks.

Props tellyworth, iandunn, craigfrancis, peterwilsoncc, johnbillion, apokalyptik.
Fixes #52506.

git-svn-id: https://develop.svn.wordpress.org/trunk@53575 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 20:33:56 +00:00
Sergey Biryukov
2ee3444874 Tests: Replace esc_url_raw() calls with sanitize_url().
Previously committed in [53455], appears to be accidentally reverted in [53562].

Follow-up to [51597], [53452], [53455], [53562].

See #39265, #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53574 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 15:07:40 +00:00
Sergey Biryukov
78c315dc00 Tests: Use more consistent wording when referring to PHP deprecation notices.
Previously committed in [53492], appears to be accidentally reverted in [53564].

Follow-up to [51619], [51695], [53492], [53563].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53573 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 15:02:18 +00:00
Sergey Biryukov
4621347494 Tests: Give the tests for adding empty post meta values more consistent names.
One of these was previously renamed to mention `update_metadata_by_mid()`.

While `update_metadata_by_mid()` is indeed called in `wp_ajax_add_meta()` to update an existing meta value, the functionality change that the test intended to verify was in the latter function.

Follow-up to [44153], [53561].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53572 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 14:41:11 +00:00
Sergey Biryukov
c6ada508e6 Tests: Put @covers tags before @params in Ajax and Formatting groups.
This makes the placement more consistent with the rest of the test suite.

Follow-up to [53561], [53562].

See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@53571 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 14:18:20 +00:00
Sergey Biryukov
c5db33f82e Media: Use correct escaping function for URLs in some legacy media functions.
This affects:
* `get_image_send_to_editor()`
* `image_link_input_fields()`

Follow-up to [7092], [7874], [8653], [11109], [11204], [11383], [12051], [12199], [19982].

Props smit08, mukesh27.
Fixes #56064.

git-svn-id: https://develop.svn.wordpress.org/trunk@53570 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-24 13:50:53 +00:00
Sergey Biryukov
ed2bf69b0f Editor: Add utility classnames back to blocks that have layout attributes specified.
[https://github.com/WordPress/gutenberg/issues/38719 In 5.9 these utility classnames were removed], which removed the ability for theme/plugin authors to assign their own custom CSS related to specific layout selections. This was mostly related to the Button block.

This commit adds these classes dynamically based on attributes, rather than saving them to the serialized content.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/41487 #41487 Add utility classnames back to blocks that have layout attributes specified]

Props glendaviesnz, peterwilsoncc, andrewserong, zieladam, matveb, samikeijonen.
See #56058.

git-svn-id: https://develop.svn.wordpress.org/trunk@53568 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 23:07:11 +00:00
Jb Audras
10cfe4945c Application Passwords: Ensure long passwords don't break the "new password" notice.
This changeset adds a `word-wrap: break-word` CSS declaration to avoid text overflow in the "new application password" notice.

Props Presskopp, hasanuzzamanshamim, yannielsen, audrasjb.
Fixes #54581.


git-svn-id: https://develop.svn.wordpress.org/trunk@53567 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 23:02:19 +00:00
Jb Audras
b9c137ceab Docs: Use third-person singular verbs for function descriptions in Bookmark related files, as per docblock standards.
This changeset updates `bookmark.php` and `bookmark-template.php` files.

See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53566 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 22:55:41 +00:00
Sergey Biryukov
984680b54e Tests: Correct the expected result for wp_ajax_replyto_comment() test with a draft post.
The "Error:" prefix was previously removed and accidentally re-added with `@covers` tags.

Follow-up to [53337], [53561].

See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@53565 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 21:36:47 +00:00
Andrew Ozz
63560d16da Build/Test Tools: Add missing @covers tags and fix the docs for the Cron test group.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.


git-svn-id: https://develop.svn.wordpress.org/trunk@53564 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 20:41:22 +00:00
Andrew Ozz
4a2c11d4fe Build/Test Tools: Fix erroneous file name, from convertInvalidEntries.php to convertInvalidEntities.php.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53563 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 20:34:26 +00:00
Andrew Ozz
5a3f8484d6 Build/Test Tools, Formatting group:
- Add and update @covers tags.
- Add and improve docs and inline comments.

Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@53562 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 20:27:34 +00:00
Andrew Ozz
db1b341dec Build/Test Tools: Add missing @covers tags for the AJAX test group.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@53561 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 19:45:24 +00:00
John Blackbourn
32ee6cb39e Themes: Add actions to template loading to assist with collecting debug info.
This introduces the following new actions which wrap the process of loading a template file:

* `wp_before_load_template`
* `wp_after_load_template`

Props rmccue, tabrisrp, peterwilsoncc

Fixes #54541


git-svn-id: https://develop.svn.wordpress.org/trunk@53560 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 18:57:24 +00:00
Aaron Jorbin
828d518988 Editor: Universalize functions for checking block editor status.
`use_block_editor_for_post_type` and `use_block_editor_for_post` can be very useful in more contexts than wp-admin, especially when a site is in transition. For example, you may want to do things on init that are different.

Neither function depends on other functions that are available only in wp-admin (other than use_block_editor_for_post() relying on use_block_editor_for_post_type() and an admin-referrer check that's historically gated by a query variable and now also gated by is_admin), therefore  moving them to wp-includes seems both feasible and beneficial

Props ethitter, jorbin.
Fixes #51819.



git-svn-id: https://develop.svn.wordpress.org/trunk@53559 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 18:46:18 +00:00
Sergey Biryukov
9f27d13efb Code Modernization: Remove dynamic properties in Tests_Media.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

In this particular case, the test class contains a `set_up()` method that sets a group of properties, which are ''used'' by the tests, but never ''changed'' by the tests.

In other words, setting these properties in the `set_up()` is an unnecessary overhead and the properties should be changed to class constants.

Notes:
* As the `$img_html` property, which was previously being set, is not actually used in any of the tests, that property has not been converted to a constant.
* The values which were previously being set using a heredoc, now use a nowdoc (supported since PHP 5.3), as they don't contain any interpolation.
* The use of constant scalar expressions (`IMG_URL`) and constant arrays (`IMG_META`) in class constants is supported since PHP 5.6.

Follow-up to [711/tests], [1260/tests], [34855], [41724], [53557].

Props jrf.
See #56033.

git-svn-id: https://develop.svn.wordpress.org/trunk@53558 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 15:01:19 +00:00
Sergey Biryukov
bafecbeab5 Code Modernization: Remove dynamic properties in Tests_*_Slashes.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

In this particular case, the test classes contain a `set_up()` method that sets a group of properties, which are ''used'' by the tests, but the values of these properties are never ''changed'' by the tests.

In other words, setting these properties in the `set_up()` is an unnecessary overhead and the properties should be changed to class constants.

Follow-up to [1041/tests], [1071/tests].

Props jrf.
See #56033.

git-svn-id: https://develop.svn.wordpress.org/trunk@53557 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-23 14:24:08 +00:00
Sergey Biryukov
2c11931a4a Tests: Improve the test for sticky posts not being moved to the front in sitemaps.
* Give the test method a most descriptive name.
* Use a single assertion for the URL list instead of a `foreach` loop to provide more context in case of failure.
* Add a failure message to each assertion, as there are multiple assertions used in the test.

Follow-up to [53548].

See #55633.

git-svn-id: https://develop.svn.wordpress.org/trunk@53556 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-22 16:50:14 +00:00
Sergey Biryukov
e7cafe6141 Code Modernization: Use the integer portion of an item position in add_submenu_page().
This fixes an `Implicit conversion from float to int loses precision` PHP 8.1 deprecation notice when adding a new admin menu item with a `float` value passed as the `$position` parameter.

This change is covered by existing unit tests and addresses 8 errors when running the test suite on PHP 8.1.

References:
* [https://php.watch/versions/8.1/deprecate-implicit-conversion-incompatible-float-string PHP 8.1: Implicit incompatible float to int conversion is deprecated]
* [https://wiki.php.net/rfc/implicit-float-int-deprecate PHP RFC: Deprecate implicit non-integer-compatible float to int conversions]

Follow-up to [52569], [53104].

Props jrf.
See #55656, #54798.

git-svn-id: https://develop.svn.wordpress.org/trunk@53555 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-22 14:53:49 +00:00
Jonathan Desrosiers
b2f9e67757 Build/Test Tools: Return an error when uploading a test coverage report fails.
`true` is now passed to the `fail_ci_if_error` input when the `codecov/codecov-action` action is used.

When uploading a code coverage report is unsuccessful, the action will now fail and return an error. This will help avoid situations like #56022 where the report was suddenly failing to upload even though the workflow itself appeared to be successful.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53554 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-22 00:18:42 +00:00
Jonathan Desrosiers
e902e52e95 Build/Test Tools: Allow changes to the code coverage workflow to run on pull request.
This adds the `pull_request` event to the Code Coverage Report workflow, allowing changes to be verified in a pull request before being committed.

The `branches` and `paths` filters are used to limit when the workflow runs to pull requests with:

- A base branch of `trunk`.
- Changing specific files that can potentially affect the way a coverage report is generated.

Reports generated on `pull_request` events are for testing purposes only and are not submitted to Codecov.

The `docker-compose.yml` file has also been added to the `paths` filter for both `push` and `pull_request` events. Changes to this file could potentially affect the environment used to generate the report (such as the ones in [53552]).

Props afragen, johnbillion, desrosj.
See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53553 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 23:59:29 +00:00
Jonathan Desrosiers
c40b46525c Build/Test Tools: Configure Xdebug modes in the local Docker environment.
One change in the update from Xdebug version 2.x to 3.x was a shift from enabling features to switching into modes.

When the version of Xdebug installed in the PHP 7.4 Docker container was updated from 2.x to 3.x, the code coverage reporting workflow stopped generating reports due to a lack of available coverage drivers.

This change adds the `XDEBUG_MODE` environment variable to the local Docker environment configuration to allow the active modes to be changed. This environment variable takes precedence over the `xdebug.mode` setting, but will not change the value of the `xdebug.mode` setting.

The `LOCAL_PHP_XDEBUG_MODE` environment variable has been added to the `.env` file and can be used to change the modes enabled in the Docker container. The code coverage reporting workflow uses this variable to enable the `coverage` mode, which is required for generating a test coverage report.

By default, `debug` and `debug modes are active, which enables the more commonly used features of Xdebug: development helpers and step debugging.

Props afragen, johnbillion, desrosj.
Fixes #56022.

git-svn-id: https://develop.svn.wordpress.org/trunk@53552 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 23:45:19 +00:00
Jb Audras
af8255775b Docs: Add missing @since mention in get_posts_query_args().
Follow-up to [53548].
See #55633.


git-svn-id: https://develop.svn.wordpress.org/trunk@53551 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 13:46:29 +00:00
Jb Audras
74882538c1 Docs: Use third-person singular verbs for function descriptions in Tests_Sitemaps_wpSitemapsPosts, as per docblock standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53550 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 13:43:16 +00:00
Jonny Harris
dfcfe0b21d Posts, Post Types: Add caching to _find_post_by_old_slug and _find_post_by_old_date functions.
Cache result of database queries in `_find_post_by_old_slug` and `_find_post_by_old_date` functions. This means that repeated requests to a url where the page is not found, will result in hitting a cache for sites running persistent object caching. 

Props Spacedmonkey, dd32, mukesh27, pbearne, flixos90.
Fixes #36723.

git-svn-id: https://develop.svn.wordpress.org/trunk@53549 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 13:32:48 +00:00
Jb Audras
d91e148452 Sitemaps: Remove duplicate sticky Posts from Sitemap Post Query.
This changeset sets the `ignore_sticky_posts` parameter to `true` in the default arguments passed to `wp_sitemaps_posts_query_args`.

Props RavanH, pbiron, swissspidy, audrasjb, SergeyBiryukov.
Fixes #55633.


git-svn-id: https://develop.svn.wordpress.org/trunk@53548 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 13:16:10 +00:00
Sergey Biryukov
a14324ca3a Docs: Improve documentation for WP_Image_Editor::save() and related functions.
Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

This affects:
 * `wp_generate_attachment_metadata()`
 * `wp_get_attachment_metadata()`
 * `WP_Image_Editor::save()`
 * `WP_Image_Editor_GD::save()` and `::_save()`
 * `WP_Image_Editor_Imagick::save()` and `::_save()`

Follow-up to [22094], [22619], [52837], [53546].

See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53547 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 11:16:09 +00:00
Sergey Biryukov
d27deea511 Docs: Correct the return type for wp_save_image_file().
Since WordPress 3.5, `wp_save_image_file()` uses `WP_Image_Editor` classes under the hood to save the images.

While the `save()` method in those instances returns `array|WP_Error` and is documented as such, the return type of the `wp_save_image_file()` function was still left as `bool`.

A better solution would be to adjust the function to return the documented boolean type. However, doing that after 20+ major WP releases would be a backward compatibility break, so the documentation is now updated instead.

Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$image` parameter expecting a `WP_Image_Editor` instance.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

Follow-up to [22094], [22619], [52837].

Props jrf, SergeyBiryukov.
See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53546 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 11:13:17 +00:00
Sergey Biryukov
53372fd5be Tests: Move assertQueryTrue() closer to the other custom assertions in WP_UnitTestCase_Base.
Follow-up to [109/tests], [26005].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53545 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 11:12:02 +00:00
Jonny Harris
40c4f11a81 REST API: Move all links to prepare_links method in theme REST API controller.
Move logic to generate link to global styles to the `prepare_links` method in theme REST API controller. This way all logic to generate links is within the `prepare_links` method, bringing this controller inline with other REST API controllers.

Props SergeyBiryukov, Spacedmonkey.
Fixes #56018.

git-svn-id: https://develop.svn.wordpress.org/trunk@53544 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-21 10:46:49 +00:00
John Blackbourn
14a468294f I18N: Correct and improve inline docs and tests for functionality related to nooped plurals.
See #55646, #55652


git-svn-id: https://develop.svn.wordpress.org/trunk@53543 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 22:55:52 +00:00
Sergey Biryukov
268015c02d Docs: Use third-person singular verbs for function descriptions in Tests_Image_Functions, per the documentation standards.
See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53542 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 22:24:03 +00:00
Sergey Biryukov
a7f868f455 Tests: Further improve Tests_Image_Functions::test_wp_crop_image*() tests.
Includes:
* Making the test method names more specific.
* Converting one-off helper methods to static closures.
* Adding a failure message to each assertion when multiple assertions are used in the test.

Follow-up to [1126/tests], [1201/tests], [53292], [53495], [53522], [53538].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53541 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 22:04:24 +00:00
Jb Audras
4e871a9cbd Embeds: Remove Meetup as an oEmbed source since the related endpoint has been deprecated.
This changeset removes Meetup as an oEmbed source, since Meetup.com have deprecated their oEmbed endpoint. The block has already been removed from the editor, see GB#35085.

Props peterwilsoncc, audrasjb, swissspidy.
Fixes #55997.


git-svn-id: https://develop.svn.wordpress.org/trunk@53540 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 21:46:27 +00:00
Jb Audras
dc385a9f47 Docs: Use third-person singular verbs for function descriptions in the Feed API, as per docblock standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@53539 602fd350-edb4-49c9-b593-d223f7449a82
2022-06-20 21:44:27 +00:00