* Make the descriptions for `update_post_author_caches()` and `update_post_caches()` more specific.
* Move the unit test into its own file, for consistency with `update_post_cache()` tests. This also allows for using shared fixtures in case more tests are added in the future.
Follow-up to [53482].
See #55716.
git-svn-id: https://develop.svn.wordpress.org/trunk@53483 602fd350-edb4-49c9-b593-d223f7449a82
For a call to `WP_Query` or a post REST API request that contains posts from multiple authors, call the `cache_users` function, to ensure that all user data for post authors is primed in
a single database query. This results in far fewer database queries on multiple author sites.
Props spacedmonkey, timothyblynjacobs, peterwilsoncc.
Fixes#55716.
git-svn-id: https://develop.svn.wordpress.org/trunk@53482 602fd350-edb4-49c9-b593-d223f7449a82
* Add a `@since` note for the `decoding` attribute in `wp_get_attachment_image()`.
* Adjust `wp_img_tag_add_decoding_attr()` DocBlocks per the documentation standards.
* Wrap some long `sprintf()` calls in unit tests for better readability. In at least one case, `the_content` was unnecessarily passed to `sprintf()` as an extra (unused) parameter.
Follow-up to [53480].
See #53232.
git-svn-id: https://develop.svn.wordpress.org/trunk@53481 602fd350-edb4-49c9-b593-d223f7449a82
Dynamically add `decoding="async"` to image tags on the front end of a site to instruct browsers to download them in parallel.
Modifies `wp_get_attachment_image()`, `get_avatar()` to include the attribute by default. Modifies `wp_filter_content_tags()` to add the attribute during the front-end render of the site.
Introduces `wp_img_tag_add_decoding_attr()` to take an image tag and modify it to include the attribute. Introduces the filter `wp_img_tag_add_decoding_attr` used to define the default value for the attribute.
Props adamsilverstein, ayeshrajans, costdev, flixos90, hellofromtonya, isaumya, michaelbourne, mihai2u, mitogh, sergiomdgomes, spacedmonkey, westonruter, peterwilsoncc.
Fixes#53232.
git-svn-id: https://develop.svn.wordpress.org/trunk@53480 602fd350-edb4-49c9-b593-d223f7449a82
This aims to make the tests more discoverable and easier to expand.
Follow-up to [50790], [53473], [53477].
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53478 602fd350-edb4-49c9-b593-d223f7449a82
This aims to clarify the intention of the tests.
Follow-up to [53473].
Props mlajo, costdev, acoulombe, azouamauriac, swissspidy, tobifjellner, peterwilsoncc, audrasjb, marekdedic, SergeyBiryukov.
See #55194.
git-svn-id: https://develop.svn.wordpress.org/trunk@53477 602fd350-edb4-49c9-b593-d223f7449a82
This changeset replaces <strong>Error</strong>: with <strong>Error:</strong>, for better consistency.
Follow-up to [53458].
Fixes#50785.
git-svn-id: https://develop.svn.wordpress.org/trunk@53476 602fd350-edb4-49c9-b593-d223f7449a82
This change fixes an alignement issue on the "Wide Line" Separator style variation on front-end, especially when used inside a column block. It changes the block `width` value from `120rem` to `100%` to avoid container overflowing.
Props kjellr, matthiaspabst, sabernhardt, audrasjb.
Fixes#53643.
git-svn-id: https://develop.svn.wordpress.org/trunk@53475 602fd350-edb4-49c9-b593-d223f7449a82
This changeset ensures `wp_rand()` returns zero instead of a random number when both `$min` and `$max` values are equal to zero.
Fixes#55194.
git-svn-id: https://develop.svn.wordpress.org/trunk@53473 602fd350-edb4-49c9-b593-d223f7449a82
Twenty Twenty's `style.css` file has `/*rtl:ignore*/` for the `.has-text-align-left` class, but that was previously missing from the `.has-text-align-right` class. As a result, the theme overrides block library styles on the front-end (and not in the editor). This changeset adds the missing declaration.
Props amirkamizi, mayankmajeji, ianbelanger, sabernhardt, hasanuzzamanshamim.
Fixes#49447.
git-svn-id: https://develop.svn.wordpress.org/trunk@53471 602fd350-edb4-49c9-b593-d223f7449a82
This changeset updates the `font-style` value of the Quote block in the block editor to ensure styles are consistent between the editor and the front-end.
Props kajalgohel, iamjaydip, audrasjb, whaze, mukesh27.
Fixes#55931.
git-svn-id: https://develop.svn.wordpress.org/trunk@53470 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the methods are recognized by the WordPress Code Reference parser.
Follow-up to [7994], [25567], [27156], [28887], [49672], [52226].
Props dd32, audrasjb.
Fixes#55928.
git-svn-id: https://develop.svn.wordpress.org/trunk@53469 602fd350-edb4-49c9-b593-d223f7449a82
This fixes the code added in [53466] to look at the correct workflow object when determining the outcome of the previous workflow run.
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53468 602fd350-edb4-49c9-b593-d223f7449a82
When searching for previous workflow runs by branch, GitHub currently includes matches within forks.
If a contributor opens a pull request from their fork with a `head_ref` matching a Core branch that triggers a workflow on `push` event, the outcomes of the workflows associated with that pull request are currently used to determine if the previous workflow run had failed.
The result is a false “fixed” notifications when a commit immediately follows a failed workflow run from the pull request.
This adds a check to skip any workflow runs not triggered by a `push` event to prevent these inaccurate notifications.
Props SergeyBiryukov.
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53466 602fd350-edb4-49c9-b593-d223f7449a82
This was unnecessarily replacing the original image metadata with a scaled version, leading to a few leftover images with the `-scaled` suffix in the `wp-content/uploads` directory.
Follow-up to [35412].
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53465 602fd350-edb4-49c9-b593-d223f7449a82
Convert some `wp_delete_post()` calls to `wp_delete_attachment()` to avoid an extra function call.
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53464 602fd350-edb4-49c9-b593-d223f7449a82
This makes sure there are no leftover images in case of a test failure.
Follow-up to [161/tests], [1255/tests].
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53463 602fd350-edb4-49c9-b593-d223f7449a82
If the path starts with a slash, it will be considered absolute and returned as is earlier in the function.
It it's not absolute, then it does not start with a slash, so there is nothing to trim.
This change is covered by existing unit tests.
Follow-up to [6984], [53457].
Props karlijnbk.
See #55897.
git-svn-id: https://develop.svn.wordpress.org/trunk@53460 602fd350-edb4-49c9-b593-d223f7449a82
This changeset fixes an issue with some CSS rules of the "Wide Line" variation of the Separator Block’s editor stylesheet, for small, medium and large screens.
Props umesh84, iamjaydip, mukesh27, larrach.
Fixes#55896.
git-svn-id: https://develop.svn.wordpress.org/trunk@53459 602fd350-edb4-49c9-b593-d223f7449a82
This aims to improve performance by calling `sanitize_url()` directly, instead of the `esc_url_raw()` wrapper. As of WordPress 6.1, `sanitize_url()` is the recommended function for sanitizing a URL for database or redirect usage.
Follow-up to [11383], [13096], [51597], [53452].
Props benjgrolleau, peterwilsoncc, SergeyBiryukov.
Fixes#55852.
git-svn-id: https://develop.svn.wordpress.org/trunk@53455 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a test failure if the `ZipArchive` class is missing.
Additionally, this commit replaces an inline check for the `ZipArchive` class in personal data export file tests with a `@requires` annotation, for consistency with similar PHP extension requirements in other tests.
Follow-up to [44786], [51415], [52286].
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53454 602fd350-edb4-49c9-b593-d223f7449a82
This replaces the only instance of the `add new media` context with `file`, used in other instances of the string.
Follow-up to [9198], [10680], [21948].
Props benjgrolleau, tobifjellner, SergeyBiryukov.
Fixes#55876.
git-svn-id: https://develop.svn.wordpress.org/trunk@53453 602fd350-edb4-49c9-b593-d223f7449a82
A general security rule is "Sanitize when you save, escape when you echo".
In WordPress 5.9, `sanitize_url()` was un-deprecated in order to better align with the naming of other sanitizing functions, while still being an alias for `esc_url_raw()`.
This commit reverses the order and turns `esc_url_raw()` into a wrapper for `sanitize_url()`, making the latter the canonical function call and aiming to improve performance by reducing the number of function calls required when using the recommended technique.
Follow-up to [11383], [13096], [51597].
Props benjgrolleau, peterwilsoncc, SergeyBiryukov.
See #55852.
git-svn-id: https://develop.svn.wordpress.org/trunk@53452 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that `.webp` images are properly recognized and displayed in the modal as expected.
Follow-up to [50810], [51227], [52073].
Props ilunabar, graham73may, sabernhardt, mukesh27, SergeyBiryukov.
Fixes#55786.
git-svn-id: https://develop.svn.wordpress.org/trunk@53451 602fd350-edb4-49c9-b593-d223f7449a82
This aims to improve developer experience by making it clear that these variables are defined elsewhere.
Props ravipatel, davidbaumwald, hellofromTonya, costdev, SergeyBiryukov.
Fixes#51439.
git-svn-id: https://develop.svn.wordpress.org/trunk@53450 602fd350-edb4-49c9-b593-d223f7449a82
Previously, setting the `show_in_quick_edit` property to `false` removed the taxonomy from the inline edit form, but several taxonomy-related database queries were still being performed in `bulk_edit_posts()` when building the arguments to pass to `wp_update_post()`, even though terms were not modified.
This commit improves performance by avoiding unnecessary database queries when `show_in_quick_edit` is `false`, and mirrors a similar check in the `get_inline_data()` function.
Follow-up to [13535], [14580], [31307], [52841], [53368].
Props Chouby, sabernhardt, costdev, nalininonstopnewsuk, webcommsat, marybaum, meher, wparslan, SergeyBiryukov.
Fixes#42474.
git-svn-id: https://develop.svn.wordpress.org/trunk@53449 602fd350-edb4-49c9-b593-d223f7449a82
No functional changes were made to Twenty Ten during the WordPress 6.0 release cycle so the theme version bump is not needed. The "tested up to" header change is maintained.
Follow up to and partial revert of [53418].
Props desrosj, ravipatel, costdev.
Fixes#55810.
See #55754.
git-svn-id: https://develop.svn.wordpress.org/trunk@53448 602fd350-edb4-49c9-b593-d223f7449a82
Append `?ver=6.0` to the image used for linking to the video to break the cache in browsers, proxy servers and on the CDN.
A new version of the image has been uploaded and replaced the file in the original location.
Props annezazu, critterverse, ryelle, costdev, ironprogrammer, dd32.
Fixes#55808.
git-svn-id: https://develop.svn.wordpress.org/trunk@53447 602fd350-edb4-49c9-b593-d223f7449a82
This fixes an `Equals sign not aligned correctly` WPCS warning.
Additionally, this commit sets the `svn:eol-style` property for the `phpunit/tests/ajax/wpAjaxCropImage.php` file and corrects line endings, so that the output of `composer format` is clean.
Follow-up to [53027], [53217], [53404].
Props hellofromTonya, SergeyBiryukov.
See #55647.
git-svn-id: https://develop.svn.wordpress.org/trunk@53441 602fd350-edb4-49c9-b593-d223f7449a82
Use longhand positioning properties (top, right, etc) so that the rtlcss build process can correctly adjust the layout for the RTL CSS.
Props ryelle, costdev, ironprogrammer, hellofromtonya.
Fixes#55793.
git-svn-id: https://develop.svn.wordpress.org/trunk@53437 602fd350-edb4-49c9-b593-d223f7449a82
MariaDB 10.2 has reached EOL in May 2022. The recommended minimum is bumped to 10.3 for now.
Follow-up to [52319], [52358], [52420], [52424], [53431], [53433], [meta11866].
Props hellofromTonya.
Fixes#55791. See #meta6322.
git-svn-id: https://develop.svn.wordpress.org/trunk@53435 602fd350-edb4-49c9-b593-d223f7449a82
Comparing human-readable dates instead of numeric timestamps gives identical results, but makes the message more clear in case of failure.
Follow-up to [33946], [52418], [52421], [52424].
See #55791, #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53433 602fd350-edb4-49c9-b593-d223f7449a82
TEMPORARY COMMIT.
MariaDB version 10.2 is no longer supported as of 23 May 2022. This commit temporarily skips the version test. Why? To avoid test failures during this period, i.e. until the version is bummped and `readme.html` file changed.
See #55791, [https://meta.trac.wordpress.org/ticket/5999 Meta5999].
git-svn-id: https://develop.svn.wordpress.org/trunk@53431 602fd350-edb4-49c9-b593-d223f7449a82
The odd / even class attribute global variables are causing issues in comments tests when a new test is added or an existing test is modified. To stabilize the odd / even comment tests, the comment global variables are added to the base test class' `tear_down()` using the same patterns as the other global resets. This change ensures each comment test starts at the same state. In doing so, the expected odd / even class attributes are no longer affected by previous tests, i.e. test leaks.
Follow-up to [53172].
Props hellofromTonya, zieladam, peterwilsoncc.
See #54725.
git-svn-id: https://develop.svn.wordpress.org/trunk@53430 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a PHP fatal error if any of these functions are called too early:
* `have_posts()`
* `in_the_loop()`
* `rewind_posts()`
* `the_post()`
* `have_comments()`
* `the_comment()`
bringing some consistency with conditional tags: `is_single()`, `is_home()`, etc.
This commit also removes unnecessary `return` from `the_comment()`, for consistency with `the_post()`. As `WP_Query::the_comment()` does not have a return value, this statement did not have any effect in practice.
Follow-up to [4934], [8807], [16947], [17068], [17083], [49147], [53395], [53396], [53400].
Props vdankbaar, thijso, teunvgisteren, timkersten655, SergeyBiryukov.
Fixes#55722.
git-svn-id: https://develop.svn.wordpress.org/trunk@53429 602fd350-edb4-49c9-b593-d223f7449a82
These properties are arrays of category IDs and tag names, respectively, not a single integer or string.
Follow-up to [21651], [31127], [32729], [48941].
Props omaeyusuke.
Fixes#55785.
git-svn-id: https://develop.svn.wordpress.org/trunk@53428 602fd350-edb4-49c9-b593-d223f7449a82
This adjusts the workflow run URLs included in Slack notifications to link to the specific attempt being reported on making it easier for someone to see the proper context of a specific notification.
Additionally, this eliminates the need for a contributor to share the reason for a failure in Slack before restarting the workflow, as the link will always be to that specificattempt. When a “fixed” notification occurs for a subsequent run attempt, the link will be to the new, successful run attempt.
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53427 602fd350-edb4-49c9-b593-d223f7449a82
`phpversion()` return value and `PHP_VERSION` constant value are identical, but the latter is several times faster because it is a direct constant value lookup compared to a function call.
Props ayeshrajans, jrf, mukesh27, costdev, hellofromTonya, SergeyBiryukov.
Fixes#55680.
git-svn-id: https://develop.svn.wordpress.org/trunk@53426 602fd350-edb4-49c9-b593-d223f7449a82