48650 Commits

Author SHA1 Message Date
Tammie Lister
efabd4cef8 WordPress 6.4 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@56821 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 16:12:04 +00:00
Tonya Mork
75532c3050 Update/Install: Deactivate Gutenberg plugin version older than 16.5.
This commit changes the Gutenberg minimum compatible version number from 14.1 (introduced in [54790]) to 16.5. For versions older than 16.5, the plugin will deactivate when upgrading WordPress to 6.4-beta3 or newer.

Changes are done within Core's `_upgrade_core_deactivate_incompatible_plugins()` which is invoked during WordPress' upgrade process.

Follow-up to [54790].

Props hellofromTonya, spacedmonkey.
Fixes #59584.

git-svn-id: https://develop.svn.wordpress.org/trunk@56820 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 15:05:34 +00:00
Jonny Harris
1f51e1f4f6 REST API: Fix issue with Template and Template Part Revision/Autosave REST API controllers.
The Template and Template Part REST API controllers have unique characteristics compared to other post type REST API controllers. They do not rely on integer IDs to reference objects; instead, they use a combination of the theme name and slug of the template, like 'twentytwentyfour//home.' Consequently, when the post types template and template part were introduced in [52062], it led to the registration of REST API endpoints for autosaves and revisions with invalid URL structures.

In this commit, we introduce new functionality to enable custom autosave and revisions endpoints to be registered at the post type level. Similar to the 'rest_controller_class' parameter, developers can now define 'revisions_rest_controller' and 'autosave_rest_controller.' This empowers developers to create custom controllers for these functionalities. Additionally, we introduce a 'late_route_registration' parameter, which proves helpful when dealing with custom URL patterns and regex pattern matching issues.
This commit registers new classes for template and template part autosave and revisions controllers, differentiating them from standard controllers in the following ways:
* The response shape now matches that of the template controller.
* Permission checks align with the template controller.
* A custom URL pattern is introduced to support slug-based identification of templates.

Furthermore, we've updated the utility function '_build_block_template_result_from_post' to support passing revision post objects. This enhancement ensures compatibility with the custom revisions controller.

Props spacedmonkey, revgeorge, andraganescu, hellofromTonya, antonvlasenko, kadamwhite, ironprogrammer, costdev, mukesh27, timothyblynjacobs, adamsilverstein. 
Fixes 56922.

git-svn-id: https://develop.svn.wordpress.org/trunk@56819 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 14:03:03 +00:00
Bernie Reiter
a9bb470f8b Patterns: Inject theme attribute into Template Part blocks.
[56805] introduced a regression: The `theme` attribute was no longer injected into Template Part blocks inside of patterns. This caused errors on the frontend, where instead of a given template part, an error message such as `Template part has been deleted or is unavailable: header` was seen.

This changeset rectifies that problem, and adds unit test coverage to guard against future regressions.

Follow-up to [56805].
Props scruffian, gziolo.
Fixes #59583.

git-svn-id: https://develop.svn.wordpress.org/trunk@56818 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 13:19:42 +00:00
Tonya Mork
4984081ef6 Options, Meta APIs: Check setting group exists before search in unregister_setting().
Checks if the given `$option_group` exists before searching for the `$option_name`. Sets the `$pos` to `false`, as `array_search()` returns `false` if the option name (needle) does not exist.

This changeset fixes 2 different PHP Warning|Notice scenarios:
1. When the global `$new_allowed_options` is `null`, fixes raising `Trying to access array offset on value of type null` PHP Notice (PHP 7.4) | Warning (on PHP 8).

2. When the global `$new_allowed_options` is an `array` and the setting group key does not exist, fixes raising "Undefined index: unknown_setting_group" PHP Notice (PHP 7) | Warning (on PHP 8).

For both scenarios, the `array_search()` is skipped and the `$pos` is set to a default of `false`, i.e. which is the value returned when `array_search()` is unsuccessful.

Props xknown, hellofromTonya, nicolefurlan, oglekler, SergeyBiryukov, shailu25.
Fixes #57674.

git-svn-id: https://develop.svn.wordpress.org/trunk@56817 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 12:50:19 +00:00
Tammie Lister
33d1242992 Update editor related npm packages for beta 3 second part.
The npm packages needed a second part to the update for beta 3 in preparation for 6.4.

Props talldan, ellatrix, santosguillamot, ramonopoly, andrewserong, artemiosans, isabel_brison, mikachan.

See #59411.


git-svn-id: https://develop.svn.wordpress.org/trunk@56816 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 11:27:50 +00:00
Sergey Biryukov
8c146ecb33 Query: Ensure that the page parameter is scalar in WP_Query::get_posts().
The `page` query var only accepts a scalar value and passes the value through functions that assume a scalar value.

Adding an extra guard condition does not affect its functionality but does avoid a PHP fatal error for `trim()` when a non-scalar value such as an array is passed.

Follow-up to [2535], [53891].

Props brookedot, rlmc, mukesh27, SergeyBiryukov.
Fixes #56558.

git-svn-id: https://develop.svn.wordpress.org/trunk@56815 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 11:20:28 +00:00
Jonny Harris
94d2f4e68b Options, Meta APIs: Prevent unnecessary database updates caused by strict comparisons in update_network_option.
Previously, in the update_network_option function, strict comparisons between old and new values could erroneously trigger updates in cases where there was no actual change in values. Building upon the groundwork laid in #22192, this commit introduces the use of the _is_equal_database_value function to accurately compare values before initiating any database updates. This change ensures consistency between the behaviors of `update_option` and `update_network_option`.

Furthermore, we have incorporated similar workarounds that were previously implemented in [56717]. These changes ensure that the raw version of network option values is considered in the comparisons, enhancing the overall reliability of the update process.

Props mukesh27, flixos90, joemcgill, costdev, spacedmonkey.
Fixes #59360.

git-svn-id: https://develop.svn.wordpress.org/trunk@56814 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 09:35:09 +00:00
Tammie Lister
c300c89f54 Changes to TT4 for beta 3.
Updates TT4 with additional changes ready for beta 3.

Props jessplease, pbwebd, poena, afercia, luminuu, beafialho, onemaggie, mhkuu,  richtabor,  benoitchantre.

Close #59575.


git-svn-id: https://develop.svn.wordpress.org/trunk@56813 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 09:01:25 +00:00
Isabel Brison
e3b7ab1897 Editor: fix incorrect block custom CSS output.
Fixes output of block custom CSS when multiple rules require a descendant selector.

Props wildworks, mikachan.
Fixes #59499.


git-svn-id: https://develop.svn.wordpress.org/trunk@56812 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-10 03:41:38 +00:00
Peter Wilson
33b32ebc4e Query: Rename _prime_post_parents_caches() for clarity.
Change the name of `_prime_post_parents_caches()` to `_prime_post_parent_id_caches()` to make it clearer only the parent post ID is cached rather than the entire post parent object.

Follow up to [56763].

Props spacedmonkey, joemcgill, peterwilsoncc.
See #59188.


git-svn-id: https://develop.svn.wordpress.org/trunk@56811 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 23:01:15 +00:00
Joe Dolson
93cc3b17a0 Administration: Fix unusable mobile admin menu in Safari.
Replace the `focusout` event handler added in [55326] with a combination of `blur` and `keyup` handler. This change handles Safari not setting focus on clicked elements.

Props afercia, joedolson, travel_girl, oglekler, rajinsharwar, marybaum, rcorrales, binsaifullah, shubhamsedani, ashikur698.
Fixes #58912.

git-svn-id: https://develop.svn.wordpress.org/trunk@56810 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 23:00:11 +00:00
Weston Ruter
fbe3732917 Administration: Remove deprecated unload event handlers and use pagehide (and pageshow) when appropriate.
Use `pagehide` event instead of `unload` in the following cases:

* For classic editor to release the post lock.
* In Text widget to rebuild editor after dragging widget to new location in classic widgets interface.
* To clear out the `window.name` when navigating away from a post preview.
* To suspend heartbeat, while also using `pageshow` event to resume as if it had been a focused tab in case page restored from bfcache. 

Also:

* Remove obsolete mobile cleanup code in `js/_enqueues/lib/gallery.js` (introduced in [9894]). Do same for `src/js/_enqueues/wp/media/models.js` (introduced in [22872]). See #22552.
* Remove obsolete Firefox-specific workaround in `js/_enqueues/wp/mce-view.js` from [39282]. See #38511.

Fixes #55491.
Props spenserhale, westonruter, adamsilverstein, azaozz, shawfactor, peterwilsoncc, swissspidy.

git-svn-id: https://develop.svn.wordpress.org/trunk@56809 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 21:29:42 +00:00
Tammie Lister
9ec564607c Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.

Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.

See #59411.


git-svn-id: https://develop.svn.wordpress.org/trunk@56808 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 17:21:30 +00:00
Felix Arntz
41cf9f0a38 Editor: Improve performance of wp_render_elements_support().
By skipping iterations in block supports when not necessary, this changeset improves performance of the function notably.

The performance enhancement leads to even a notable improvement for overall page load time: For example, the Twenty Twenty-Four home page loads ~2% faster with this changeset.

Props dmsnell, spacedmonkey, costdev, hellofromTonya, aaronrobertshaw.
Fixes #59544.


git-svn-id: https://develop.svn.wordpress.org/trunk@56807 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 17:05:31 +00:00
Felix Arntz
4d5859bece Editor: Add additional unit tests for elements block support.
Props aaronrobertshaw, costdev.
Fixes #59555.
See #59544.


git-svn-id: https://develop.svn.wordpress.org/trunk@56806 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 16:38:26 +00:00
Bernie Reiter
9d039e6c91 Blocks: Call get_hooked_blocks only once per template/part/pattern.
Prior to this changeset, `get_hooked_blocks` was called four times ''for every parsed block'' in each template, template part, and pattern. With this changeset applied, `get_hooked_blocks` is called only once per template, template part, or pattern.

Additionally, `get_hooked_blocks` is called only once when returning the list of all registered patterns. (The latter modification brings the implementation closer to its state prior to Block Hooks.)

Finally, when there are no registered hooked blocks or `hooked_block_types` filters, parsing, hooked block insertion, and re-serializing is skipped altogether.

Props gziolo, flixos90, joemcgill, dmsnell, spacedmonkey, hellofromtonya.
Fixes #59383.

git-svn-id: https://develop.svn.wordpress.org/trunk@56805 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 16:38:25 +00:00
K. Adam White
a55dcf46b8 REST API: Correct parsing of password from Authorization header when processing Application Password credentials.
Exit early when parsing Application Password credentials if Authorization header value does not contain at least one colon. The `Authorization` Basic header must use a colon to separate the username and password components per RFC 7617, so a username-only string is malformed and should not be processed.

Split `Authorization` header only on the first colon, properly handling passwords containing colons.

Resolves PHP 8.0 warning when `list()` was called on an exploded credentials array containing only one element.

Props kalpeshh, shooper, sc0ttkclark, jrf, mukesh27, oglekler, nicolefurlan.
Fixes #57512.



git-svn-id: https://develop.svn.wordpress.org/trunk@56804 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 14:47:57 +00:00
Sergey Biryukov
4c059cca12 Code Modernization: Update parameter names in the WP_Block_List class.
This makes the parameter names consistent with the `ArrayAccess` interface.

Reference: [https://www.php.net/manual/en/class.arrayaccess.php PHP Manual: The ArrayAccess interface].

Follow-up to [48159].

Props rahmohn.
See #58976.

git-svn-id: https://develop.svn.wordpress.org/trunk@56803 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-09 11:21:30 +00:00
Joe Dolson
eb0ae5679a Quick/Bulk Edit: Fix inability to quick edit draft post date.
Follow up to [56022] to fix inability to set a date/time in quick editing. Allow a user to set a quick/edit date while preventing accidental date assignments per the original intent.

Props tristanleboss, ivanzhuck, tibbsa, sabernhardt, sergeybiryukov, oandregal, khokansardar, joedolson, shailu25.
Fixes #59125. See #19907.

git-svn-id: https://develop.svn.wordpress.org/trunk@56802 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-08 20:08:08 +00:00
Joe Dolson
662e1c639f Upload: Fix misalignment of 'Copied' message.
Add `display: flex` to `.copy-to-clipboard-container` to fix alignment of elements within the container.

Props sujichandran14, oglekler, sarathar, huzaifaalmesbah, nicolefurlan, joemcgill, dkotter.
Fixes #58829.

git-svn-id: https://develop.svn.wordpress.org/trunk@56801 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-08 18:19:53 +00:00
Joe Dolson
1e3214a977 Administration: Add missing space in theme activation notices.
Restore missing space in two admin notices during theme activation.

Props shailu25, sergeybiryukov, mukesh27, hellofromtonya.
Fixes #59501. See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56800 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-08 17:54:21 +00:00
Sergey Biryukov
9b2ed59437 Coding Standards: Upgrade WPCS to version 3.0.1.
In WordPressCS 3.0.0, the functionality of the `WordPress.Security.EscapeOutput` sniff was updated to report unescaped message parameters passed to exceptions created in `throw` statements. This specific violation now has a separate error code: `ExceptionNotEscaped`. This will allow users to ignore or exclude that specific error code.

The error code(s) for other escaping issues flagged by the sniff remain unchanged.

References:
* [https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.0.1 WPCS 3.0.1 release notes]
* [https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.0...3.0.1 Full list of changes in WPCS 3.0.1]

Follow-up to [56695].

Props jrf, bjorsch, dawidurbanski.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56799 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-08 13:07:46 +00:00
Sergey Biryukov
f0b32ccf63 Coding Standards: Correct alignment in wp-admin/user-edit.php.
This resolves a WPCS warning:
{{{
Array double arrow not aligned correctly;
expected 1 space(s) between "'type'" and double arrow, but found 15.
}}}

Follow-up to [56570], [56680].

Props jrf.
See #59161, #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56798 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-07 13:53:10 +00:00
Felix Arntz
36d4e7ebcc Options, Meta APIs: Add test coverage for update_network_option() comparison of new and existing value.
Having those tests in `trunk` already will help ensure potential future fixes to this logic maintain backward compatibility.

Props mukesh27, spacedmonkey.
See #59360.


git-svn-id: https://develop.svn.wordpress.org/trunk@56797 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-06 17:01:48 +00:00
Felix Arntz
cc64ed22bd Options, Meta APIs: Fix bug with update_option() updating the wrong cache, leading to potentially stale values being returned.
When using the `$autoload` parameter of `update_option()` alongside an option value update, prior to this changeset the function would update the incorrect cache, not respecting the new autoload value. This could have severe implications such as returning a stale option value when the option in fact had already been deleted.

This changeset fixes the bug alongside test coverage that failed with `trunk` but now passes.

Props kkmuffme, pentatonicfunk, SergeyBiryukov, oglekler, azaozz, spacedmonkey, nicolefurlan, joemcgill, flixos90.
Fixes #51352.


git-svn-id: https://develop.svn.wordpress.org/trunk@56796 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-06 16:31:22 +00:00
Sergey Biryukov
478cd02dfe Editor: Move wp_navigation schema updating to WP_Navigation_Fallback class.
This aims to better align the navigation fallback implementation with core architecture and best practices.

The function that updates the `wp_navigation` post response schema is now a public method of the `WP_Navigation_Fallback` class, so an extra file previously used for that specific function is no longer necessary.

Follow-up to [56052].

Props ramonopoly, scruffian, isabel_brison, mukesh27, swissspidy, rajinsharwar, afercia, audrasjb, mikeschroder, JeffPaul, johnjamesjacoby, TimothyBlynJacobs, oglekler, SergeyBiryukov.
Fixes #58910.

git-svn-id: https://develop.svn.wordpress.org/trunk@56793 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-06 14:04:22 +00:00
Jonathan Desrosiers
987ea9bbf8 Build/Test Tools: Check for zero-byte files in themes.
Because the contents of binary files are not included in patches by default, occasionally empty versions of these files are committed on accident. This is the most commonly happens within default themes because they usually contain image and font files.

This adds a job to the theme related GitHub Action workflow that checks for the presence of zero-byte files so that these instances are caught more easily.

Props costdev, hellofromTonya, luminuu, onemaggie.
Fixes #59527.

git-svn-id: https://develop.svn.wordpress.org/trunk@56792 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-06 12:45:43 +00:00
Jb Audras
64b699e8e3 Twenty Twenty-Three: Add missing font licenses in readme.txt file.
Props benimub.
Fixes #59483.





git-svn-id: https://develop.svn.wordpress.org/trunk@56791 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-05 22:44:03 +00:00
Sergey Biryukov
7c12150a80 HTML API: Rename WP_HTML_Processor::createFragment() to follow WPCS.
`WP_HTML_Processor::create_fragment()` is the correct method name as per the WordPress PHP coding standards.

Follow-up to [56274].

Props dmsnell, jrf, hellofromTonya, SergeyBiryukov.
Fixes #59547.

git-svn-id: https://develop.svn.wordpress.org/trunk@56790 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-05 22:40:48 +00:00
Felix Arntz
b77b8fd822 Options, Meta APIs: Fix minor compatibility issue with update_option() change.
When calling `update_option()` with value `false` on a non-existent option, prior to [56681] the function would have returned `false` and not stored the value in the database, since the given value was the same as the default.

The aforementioned changeset broke that promise with good intention, however this particular change was a backward compatibility break and therefore is resolved here.

Props mukesh27, costdev.
Fixes #22192.


git-svn-id: https://develop.svn.wordpress.org/trunk@56788 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-05 16:13:38 +00:00
Joe McGill
23c811e59f Themes: Fix core block style paths on Windows.
This is a follow-up to [56528], which normalizes the `BLOCKS_PATH` for Windows prior to making paths relative for caches during the registration process. Prior to this change, incorrect file paths would lead to broken styles for core blocks on Windows.

Props wildworks, pbiron, flixos90, joemcgill.
Fixes #59489. See #59111.


git-svn-id: https://develop.svn.wordpress.org/trunk@56785 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 22:21:17 +00:00
Jb Audras
89da2ff3a9 Twenty Twenty: Fix style issues within iframed editor.
This changeset:
- Replaces `body` with `html` for the first CSS selector that makes text white against a dark background
- Moves `twentytwenty_block_editor_styles()` from the `enqueue_block_editor_assets` action to `enqueue_block_assets` for WordPress 6.3 and later
- Removes the obsolete `twentytwenty-block-editor-script` from the styles function to avoid an error in the iframe

Props floydwilde, poena, huzaifaalmesbah, greenshady, sabernhardt, audrasjb, pooja1210, shailu25, joemcgill.
Fixes #59086.





git-svn-id: https://develop.svn.wordpress.org/trunk@56783 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 20:54:34 +00:00
Jonathan Desrosiers
0d844c1c34 Build/Test Tools: Don’t send a Slack notice for a workflow’s first failure.
After [53947], all workflows will automatically be restarted once in an attempt to rule out reasons for failures, such as timeouts or network hiccups.

Second attempt at [56404], which was previously reverted in [56407].
See #58867.

git-svn-id: https://develop.svn.wordpress.org/trunk@56780 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 19:12:15 +00:00
Jb Audras
058cd259bc Editor: Fix wrong @since mention in remove_insecure_properties().
Follow-up to [56502].

See #59108.





git-svn-id: https://develop.svn.wordpress.org/trunk@56778 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 19:01:49 +00:00
Tonya Mork
ddbce71885 Twenty Twenty-Four: Fix 6.4 Beta 2 image assets.
Fixes the image assets from [56764] for the images to properly render.

Adds binary file contents (resolves 0 bytes issue) and svn:mime-type property:
* abstract-geometric-art.webp
* building-exterior.webp
* hotel-facade.webp
* museum.webp
* tourist-and-building.webp
* windows.webp

Updates the binary file contents for renamed images:
* angular-roof.webp
* art-gallery.webp
* green-staircase.webp

Follow-up to [56764].

Unprops hellofromTonya.
Props onemaggie, luminuu, colorful-tones, desrosj, mukesh27, nendeb55, nicolefurlan, satishprajapati, shailu25.
Fixes #59526.
See #59524.

git-svn-id: https://develop.svn.wordpress.org/trunk@56775 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 17:00:12 +00:00
Sergey Biryukov
5fce177861 Docs: Use 3-digit, x.x.x style semantic versioning for two @since entries.
Follow-up to [41626], [56541].

See #58833.

git-svn-id: https://develop.svn.wordpress.org/trunk@56774 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 15:10:56 +00:00
Jonny Harris
5a58e171d4 Docs: Improve documentation for _prime_post_parents_caches().
Add in missing since PHPDoc block for `_prime_post_parents_caches` function added in [56763].

Props mukesh27.
See #59188

git-svn-id: https://develop.svn.wordpress.org/trunk@56773 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 12:14:50 +00:00
Sergey Biryukov
d9edabf016 Twenty Fourteen: Correct @since entry for an authors list query arguments filter.
Follow-up to [51943].

See #58833.

git-svn-id: https://develop.svn.wordpress.org/trunk@56772 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-04 12:12:56 +00:00
Felix Arntz
d8206d2167 Editor: Simplify return shape and logic of _wp_get_block_patterns().
Follow up to [56765].

Props spacedmonkey.
Fixes #59490.


git-svn-id: https://develop.svn.wordpress.org/trunk@56771 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 18:17:03 +00:00
Jonathan Desrosiers
e624c1278a Build/Test Tools: Test Twenty Twenty-Four.
This adds Twenty Twenty-Four to the Default Theme test workflow in GitHub Actions.

Follow up to [56764], [56726], [56721], [56716].
See #59447.

git-svn-id: https://develop.svn.wordpress.org/trunk@56770 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 18:11:01 +00:00
Tonya Mork
046ce88332 Post WordPress 6.4 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@56769 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 17:07:21 +00:00
Tonya Mork
8c74bce2e4 WordPress 6.4 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@56768 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 16:30:41 +00:00
Sergey Biryukov
17e518ae0e Docs: Improve documentation for get_avatar() and related functions.
Includes:
* Expanding and synchronizing documentation for the `default` and `rating` arguments.
* Adding `@since` entries for the `loading`, `fetchpriority`, and `decoding` arguments.
* Wrapping long lines as per the documentation standards.
* Fixing a typo in the `identicon` value.
* Minor formatting edits for consistency.

Follow-up to [31107], [45632], [47554], [53480], [56037].

See #58833.

git-svn-id: https://develop.svn.wordpress.org/trunk@56767 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 16:13:43 +00:00
Tonya Mork
1a30f7d2fa Query: Fix a PHPCS issue in _prime_post_parents_caches() tests.
Removes an extraneous line break in the `_prime_post_parents_caches()` tests.

Follow-up to [56763].

Unprops spacedmonkey.
Props mukesh27, costdev.
See #59188.

git-svn-id: https://develop.svn.wordpress.org/trunk@56766 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 15:42:06 +00:00
Jonny Harris
3ad20183b0 Editor: Improve performance of _register_theme_block_patterns function.
The `_register_theme_block_patterns` function imposed a significant resource overhead. This issue primarily stems from themes, such as TT4, that register a substantial number of block patterns. These patterns necessitate numerous file operations, including file lookups, file reading into memory, and related processes. To provide an overview, the _register_theme_block_patterns function performed the following file operations:

- is_dir
- is_readable
- file_exists
- glob
- file_get_contents (utilized via get_file_data)

To address these issues, caching using a transient has been added to a new function call `_wp_get_block_patterns`. If theme development mode is disabled and theme exists, the block patterns are saved in a transient cache. This cache is used all requests after that, saving file lookups and reading files into memory. Cache invalidation is done, when themes are switched, deleted or updated. Meaning that block patterns are not stored in the cache incorrectly. 

Props flixos90, joemcgill, peterwilsoncc, costdev, swissspidy, aristath, westonruter, spacedmonkey.
Fixes #59490

git-svn-id: https://develop.svn.wordpress.org/trunk@56765 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 15:16:55 +00:00
Tonya Mork
d5505fc3b3 Bundled Themes: Update TT4 for 6.4 Beta 2.
Twenty Twenty-Four (TT4) updates for 6.4 Beta 2.

Changes include bugfixes from the theme's development repo since Beta 1 such as: 
* Renamed patterns and images
* Improved image descriptions
* Polished a few of the templates to fit better the design
* Addressed some a11y concerns.
* Changed the required version to 6.4, aligning it with the last few default themes since we are making use of some of the features that will make it to 6.4, such as aspect ratio.

Follow-up to [56726], [56721], [56716].

Props onemaggie, desrosj, mukesh27.
Fixes #59524.

git-svn-id: https://develop.svn.wordpress.org/trunk@56764 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 15:12:30 +00:00
Jonny Harris
6ee34689ca Query: Improve caching behavior for WP_Query when retrieving id=>parent fields
In [53941], the addition of query caching to `WP_Query` brought about an unintended issue when querying for fields equal to id=>parent. Specifically, on websites with object caching enabled and a substantial number of pages, the second run of this query triggered the `_prime_post_caches` function for id=>parent. This led to the unnecessary priming of post, meta, and term caches, even when only id and parent information were requested.

This commit addresses this issue by introducing a new function, `_prime_post_parents_caches`, which primes a dedicated cache for post parents. This cache is primed during the initial query execution. Subsequently, the `wp_cache_get_multiple` function is employed to retrieve all post parent data in a single object cache request, optimizing performance.

Additionally, this commit extends the coverage of existing unit tests to ensure the reliability of the changes.

Props kevinfodness, joemcgill, peterwilsoncc, LinSoftware, thekt12, spacedmonkey.
Fixes #59188

git-svn-id: https://develop.svn.wordpress.org/trunk@56763 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 14:59:22 +00:00
Felix Arntz
53eff06da7 Options, Meta APIs: Implement additional tests covering update_option().
As a follow up to [56681], this changeset adds further tests, primarily focused on ensuring no unnecessary database queries are run.

Props mukesh27, costdev, joemcgill, spacedmonkey.
See #22192.


git-svn-id: https://develop.svn.wordpress.org/trunk@56762 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 14:09:07 +00:00
Greg Ziółkowski
ea502c4570 Tests: Rename and improve the blocks/context.php file to follow handbook
Renames `context.php` and `Tests_Blocks_Context` to `renderBlock.php` and `Tests_Blocks_RenderBlock`. See https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#test-classes. 

Simplifies also the tear_down method by using the same convention as in [56759].

Props costdev, ockham.
Follow-up [48224].
See #49927.



git-svn-id: https://develop.svn.wordpress.org/trunk@56761 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 08:52:54 +00:00