Commit Graph

36633 Commits

Author SHA1 Message Date
youknowriad
780d126082 REST API: Allow view access of template endpoint to anyone with the edit_post capability.
In order to render the block template in the locked template preview inside the post editor we need to be able to fetch the contents of any block templates/template parts for any user role that can edit a post.

Props fabiankaegy, youknowriad.
Fixes #61137.
Built from https://develop.svn.wordpress.org/trunk@58227


git-svn-id: http://core.svn.wordpress.org/trunk@57690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-29 07:21:16 +00:00
isabel_brison
0bf7df15f3 Editor: improve consistency of root padding.
Improve the behaviour of global padding when useRootPaddingAwareAlignments is enabled in theme.json to be more consistent across blocks, templates and patterns.

Props richtabor, isabel_brison, andrewserong.
Fixes #61304.

Built from https://develop.svn.wordpress.org/trunk@58226


git-svn-id: http://core.svn.wordpress.org/trunk@57689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-29 05:15:14 +00:00
Pascal Birchler
87a182ab6f REST API: Refactor global styles endpoints in REST API to register with post type.
Updated the global styles endpoints in the REST API to extend from existing posts and revisions controllers. This reduces duplicated code and inconsistencies. The revisions controller is now a subclass of the `WP_REST_Revisions_Controller`. Related redundant methods were removed and schema generation and collection parameters were adjusted to suit the global styles context. Updated permission checks, constructor, and collection parameters accordingly. This change allows for easy override of these classes using the `register_post_type_args` filter.

This reintroduces [57624] (reverted in [57628]) with improved backward compatibility and further enhancements.

Props ramonopoly, spacedmonkey, mukesh27, swissspidy.
Fixes #60131.
Built from https://develop.svn.wordpress.org/trunk@58225


git-svn-id: http://core.svn.wordpress.org/trunk@57688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-28 12:40:16 +00:00
Sergey Biryukov
61b45944d1 Docs: Clarify that the $wp_error parameter of login_header() is nullable.
Follow-up to [7991], [25701], [28792], [43457], [58209], [58220].

See #60668, #60699.
Built from https://develop.svn.wordpress.org/trunk@58224


git-svn-id: http://core.svn.wordpress.org/trunk@57687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-28 11:13:12 +00:00
youknowriad
bd5882e27b Toolbar: Update the site editor link in the Admin Bar.
The details page is being removed from the site editor in 6.6. we need to direct the admin bar menu item to the "edit" mode page directly.

Props youknowriad, mamaduka.
Fixes #61266.
Built from https://develop.svn.wordpress.org/trunk@58223


git-svn-id: http://core.svn.wordpress.org/trunk@57686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-28 08:02:16 +00:00
noisysocks
1284a7fe99 Block Themes: Allow setting site-wide background images in theme.json
Syncs the necessary changes from Gutenberg to allow setting site-wide
background images using the top-level `styles.background` key in `theme.json`.

Props ramonopoly.
Fixes #61123.

Built from https://develop.svn.wordpress.org/trunk@58222


git-svn-id: http://core.svn.wordpress.org/trunk@57685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-28 06:06:11 +00:00
Peter Wilson
d66894e50d Build/Test Tools: Assert files exist/do not exist directly.
Replaces various boolean assertions wrapping `file_exists()` with either `assertFileExists()` or `assertFileDoesNotExist()` as appropriate for the test.

Props peterwilsoncc, mukesh27.
See #60705.

Built from https://develop.svn.wordpress.org/trunk@58221


git-svn-id: http://core.svn.wordpress.org/trunk@57684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-28 05:27:13 +00:00
audrasjb
477e688d1c Login and Registration: login_header() docblock update after [58209].
This changeset indicates that the `$title` parameter is now nullable.

Follow-up to [58209].

Props skithund.
Fixes #60668.



Built from https://develop.svn.wordpress.org/trunk@58220


git-svn-id: http://core.svn.wordpress.org/trunk@57683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 21:32:13 +00:00
audrasjb
407584f9ef External Libraries: Revert some unwanted changes after [58218].
This reverts some unwanted changes related to `react` and react-dom` versions in `$vendor_scripts_versions`.

Follow-up to [58218].

Unprops audrasjb.
Fixes #61090.



Built from https://develop.svn.wordpress.org/trunk@58219


git-svn-id: http://core.svn.wordpress.org/trunk@57682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 21:22:10 +00:00
audrasjb
12541213c1 External Libraries: Update the jQuery UI library to version 1.13.3.
For more information on the changes included, see https://blog.jqueryui.com/2024/04/jquery-ui-1-13-3-released/.

Props audrasjb, desrosj, khokansardar, swissspidy.
Fixes #61090.



Built from https://develop.svn.wordpress.org/trunk@58218


git-svn-id: http://core.svn.wordpress.org/trunk@57681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 21:14:15 +00:00
joedolson
3b1f9c8c28 Media: Add missing units for length and dimensions in media library.
Include explicit units for media length and dimensions in attachment modal and media details screen.

Props Presskopp, joedolson, shailu25, audrasjb.
Fixes #59009.
Built from https://develop.svn.wordpress.org/trunk@58217


git-svn-id: http://core.svn.wordpress.org/trunk@57680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 19:44:14 +00:00
Pascal Birchler
bba7f1effc Build/Test Tools: Update REST API fixtures after [58211].
See #41172.
Built from https://develop.svn.wordpress.org/trunk@58216


git-svn-id: http://core.svn.wordpress.org/trunk@57679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 19:05:13 +00:00
joedolson
e7afd14793 Toolbar: Accessibility: Fix keyboard focus order of search form.
Change the priority of the search form & remove `float` so that the visual position of the form matches it's positioning in the DOM.

This sets the priority of the search form to an arbitrarily high value of `9999` to ensure it will generally be last in the DOM.

Props joedolson, sabernhardt, audrasjb.
Fixes #60685.
Built from https://develop.svn.wordpress.org/trunk@58215


git-svn-id: http://core.svn.wordpress.org/trunk@57678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 18:41:15 +00:00
joedolson
f07a796aab Media: Improve scale/crop layout in image editor medium breakpoints.
Adjust the max-width of the image edit settings panel so that reflow handling at intermediary breakpoints is more consistent and less fragile.

Props deepakvijayan, huzaifaalmesbah, joedolson, khokansardar.
Fixes #58979.
Built from https://develop.svn.wordpress.org/trunk@58214


git-svn-id: http://core.svn.wordpress.org/trunk@57677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 18:03:13 +00:00
joedolson
68197542eb Themes: Accessibility: Logo block returns empty link when image not set.
The logo block does not use theme mods, and instead saves a site-wide option `site_logo` to use as the site logo. 

Add handling for cases where the logo image does not exist and delete the `site_logo` option when the attachment configured as site logo is deleted.

Props afercia, joedolson, khokansardar, SergeyBiryukov.
Fixes #60922.
Built from https://develop.svn.wordpress.org/trunk@58213


git-svn-id: http://core.svn.wordpress.org/trunk@57676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 16:41:10 +00:00
Sergey Biryukov
f6973306ea Docs: Improve documentation for a few functions accepting a WP_Post object.
Follow-up to [15777], [23769], [24490], [25697], [37252], [49544].

See #60699.
Built from https://develop.svn.wordpress.org/trunk@58212


git-svn-id: http://core.svn.wordpress.org/trunk@57675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 16:29:16 +00:00
Pascal Birchler
b2b6166091 Posts, Post Types: Remove now obsolete hardcoded attachment check for autosave support.
Follow-up to [58201].

Props swissspidy, spacedmonkey.
See #41172.
Built from https://develop.svn.wordpress.org/trunk@58211


git-svn-id: http://core.svn.wordpress.org/trunk@57674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 15:24:13 +00:00
audrasjb
21b8312b48 Upload: Add missing escaping functions in wp-admin/async-upload.php.
Props nareshbheda, mukesh27.
Fixes #60978.



Built from https://develop.svn.wordpress.org/trunk@58210


git-svn-id: http://core.svn.wordpress.org/trunk@57673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 14:31:13 +00:00
audrasjb
fb4fcb4388 Login and Registration: Ensure login header title is translatable.
This changeset ensures the login header default title string is translatable in `login_header()`.

Props juliobox, swissspidy, audrasjb.
Fixes #60668.



Built from https://develop.svn.wordpress.org/trunk@58209


git-svn-id: http://core.svn.wordpress.org/trunk@57672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 14:11:12 +00:00
audrasjb
9df0603c96 HTTP API: Improve download_url() error message.
This changeset improves the error message returned when no URL is provided, and updates the related unit tests accordingly.

Props hinnerk, audrasjb.
Fixes #60565.



Built from https://develop.svn.wordpress.org/trunk@58208


git-svn-id: http://core.svn.wordpress.org/trunk@57671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 13:55:12 +00:00
Tammie Lister
fd798307a0 Twenty Seventeen: Resolves image block caption text alignment inconsitency.
The caption for image block was misaligned. The issue appeared in 5.8 due to the block class name change making the selector meaningless. This is resolved by a change in the selectors.

Props nkeller15, sabernhardt, thakordarshil, anilvaza, shailu25, pavanpatil1, darshitrajyaguru97.
Fixes #58539.

Built from https://develop.svn.wordpress.org/trunk@58207


git-svn-id: http://core.svn.wordpress.org/trunk@57670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 12:43:11 +00:00
Tammie Lister
b4aa9d18b1 Twenty Seventeen: Add filter for display of featured image in header.
When a layout doesn't use custom post types it was appearing broken. This adds a filter for the display of the featured image to resolve this.

Props justnorris, JPry, davidakennedy, SergeyBiryukov, zkarj, poena, nhrrob, lamarajan.
Fixes #39281.

Built from https://develop.svn.wordpress.org/trunk@58206


git-svn-id: http://core.svn.wordpress.org/trunk@57669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 12:28:18 +00:00
Tammie Lister
31b37a5eb3 Twenty Twenty: Fixes button link not inheriting custom letter spacing.
The button block link did not inherit the custom letter spacing. This resolves that issue.

Props nidhidhandhukiya, sabernhardt, wesatintellitonic, pooja1210, shailu25.
Fixes #58024.

Built from https://develop.svn.wordpress.org/trunk@58205


git-svn-id: http://core.svn.wordpress.org/trunk@57668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 10:46:13 +00:00
Tammie Lister
4c8cceb51a Twenty Seventeen: Resolves latest comments author font weight difference.
The latest comments author font weight was showing different between editor and front. This fixes that and also removes an extra ruleset. 

Props pitamdey, sabernhardt, shailu25, naeemhaque, darshitrajyaguru97.
Fixes #61180.

Built from https://develop.svn.wordpress.org/trunk@58204


git-svn-id: http://core.svn.wordpress.org/trunk@57667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 10:31:11 +00:00
Tammie Lister
57dc7cd16c Twenty Twenty-One: Test failure fix for theme [58202].
Compiling stylesheets to pass tests.

See #52551.

Built from https://develop.svn.wordpress.org/trunk@58203


git-svn-id: http://core.svn.wordpress.org/trunk@57666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 10:28:13 +00:00
Tammie Lister
a17042b780 Twenty Twenty-One: Fixes Search Box Alignment.
The search box alignment was not in alignment. This brings in a resolution for that through the margin.

Props vinita29, SergeyBiryukov, poena, shailu25, makdiahussain, imranhasanraaz, darshitrajyaguru97, lamarajan.
Fixes #52551.

Built from https://develop.svn.wordpress.org/trunk@58202


git-svn-id: http://core.svn.wordpress.org/trunk@57665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 10:04:15 +00:00
Pascal Birchler
3504e15aa9 Posts, Post Types: Autosave: Allow disabling autosave support per post type.
Not all post types support autosaving. By making autosave a post type feature, support can be more granularly handled without any workarounds or hardcoded allowlists. `wp_font_family` and `wp_font_face` are examples of built-in post types which do not support autosave.

For backward compatibility reasons, adding `editor` support implies `autosave` support, so one would need to explicitly use `remove_post_type_support()` to remove it again.

Props swissspidy, youknowriad, hellofromtonya, peterwilsoncc.
Fixes #41172.
Built from https://develop.svn.wordpress.org/trunk@58201


git-svn-id: http://core.svn.wordpress.org/trunk@57664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-27 09:06:16 +00:00
Sergey Biryukov
eba0df8c7b Docs: Correct the placement of @global tags in various files.
Follow-up to [6589], [8598], [10798], [25490], [25594], [31192], [31194], [35718], [37437], [44169], [44948], [45247], [56763], [56773], [57370], [57503].

Props shailu25.
Fixes #61295.
Built from https://develop.svn.wordpress.org/trunk@58200


git-svn-id: http://core.svn.wordpress.org/trunk@57663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-26 20:51:13 +00:00
Tammie Lister
56ce2e58de Twenty Nineteen: Resolves button block font issues.
The font on buttons was displaying less than the font size when applied through the editor. This resets the relative measurement on wp-block-button__link when either its Buttons or Button block has a custom size.

Props nidhidhandhukiya, sabernhardt, SergeyBiryukov, manojmaharrshi, darshitrajyaguru97, shailu25.
Fixes #56443.

Built from https://develop.svn.wordpress.org/trunk@58199


git-svn-id: http://core.svn.wordpress.org/trunk@57662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-26 08:49:09 +00:00
Tammie Lister
a9135c617a Twenty Nineteen: Make h1 consistent for entry title.
The h1 for entry-title was not the same between the editor and front end. This fixes that in the by setting wp-block-post-title font sizes together with h2 and combines post-section-dash mixin for both h1 and h2.

Props sabernhardt, nkeller15, shailu25.
Fixes #58440.

Built from https://develop.svn.wordpress.org/trunk@58198


git-svn-id: http://core.svn.wordpress.org/trunk@57661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-26 08:32:13 +00:00
Sergey Biryukov
5941fea0b3 Docs: Update pre_do_shortcode_tag and do_shortcode_tag filter DocBlocks.
This reflects the return type change of `shortcode_parse_atts()` from `array|string` to `array` in WordPress 6.5.

Follow-up to [38506], [38713], [39665], [55711], [57597], [58168].

Props marherumr.
Fixes #61288.
Built from https://develop.svn.wordpress.org/trunk@58197


git-svn-id: http://core.svn.wordpress.org/trunk@57660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-25 03:04:12 +00:00
Sergey Biryukov
991a96b968 Docs: Add a @since note for the changes to safecss_filter_attr() in WP 6.6.
Follow-up to [58170].

See #61111.
Built from https://develop.svn.wordpress.org/trunk@58196


git-svn-id: http://core.svn.wordpress.org/trunk@57659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-24 09:49:07 +00:00
gziolo
b3e3c8ba32 Interactivity API: Include preact/debug when SCRIPT_DEBUG is enabled
Syncs the changes from Gutenberg: https://github.com/WordPress/gutenberg/pull/60514. Enqueues a different Interactivity API runtime version with preact/debug when SCRIPT_DEBUG is enabled.

Props darerodz, jonsurrell, gziolo.
Fixes #61171.


Built from https://develop.svn.wordpress.org/trunk@58195


git-svn-id: http://core.svn.wordpress.org/trunk@57658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-24 09:42:09 +00:00
Pascal Birchler
03ed152078 Editor: fix PHP warnings in tests after [58170].
Props peterwilsoncc.
Fixes #61111.
Built from https://develop.svn.wordpress.org/trunk@58194


git-svn-id: http://core.svn.wordpress.org/trunk@57657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-24 08:31:11 +00:00
gziolo
76b498103c Build: Add globalThis DefinePlugin config to webpack
This updates the build to account for related changes in WordPress packages. More details in https://github.com/WordPress/gutenberg/pull/61486.

Props jonsurrell, youknowriad, swissspidy, gziolo.
Fixes #61262.



Built from https://develop.svn.wordpress.org/trunk@58193


git-svn-id: http://core.svn.wordpress.org/trunk@57656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-24 08:00:11 +00:00
dmsnell
ec7c61e320 HTML API: Add expects_closer() method to HTML Processor
This patch adds a new method, `WP_HTML_Processor->expects_closer()` to indicate
if the currently-matched node expects to find a closing token. For example, a
`DIV` element expects a closing `</div>` tag, but an `<img>` expects none, because
it's a void element. Similarly, `#text` nodes and HTML comments only appear as
unitary nodes on the stack of open elements. Once proceeding further in the
document they are immediately removed without any closing tag.

This new method serves as a helper to indicate whether or not to expect the
closer, as this can be more complicated than it seems, and calling code
shouldn't have to build custom interpretations and implementations. Instead,
the HTML Processor ought to export its internal knowledge to make it easy for
consuming code and projects.

Developed in https://github.com/WordPress/wordpress-develop/pull/6600
Discussed in https://core.trac.wordpress.org/ticket/61257

Fixes #61257.
Props dmsnell, jonsurrell.


Built from https://develop.svn.wordpress.org/trunk@58192


git-svn-id: http://core.svn.wordpress.org/trunk@57655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-24 01:21:10 +00:00
dmsnell
07a35d5d41 HTML API: Add method to report depth of currently-matched node.
The HTML Processor maintains a stack of open elements, where every element,
every `#text` node, every HTML comment, and other node is pushed and popped while
traversing the document. The "depth" of each of these nodes represents how deep
that stack is where the node appears. Unfortunately this information isn't
exposed to calling code, which has led different projects to attempt to
calculate this value externally. This isn't always trivial, but the HTML
Processor could make it so by exposing the internal knowledge in a new method.

In this patch the `get_current_depth()` method returns just that. Since the
processor always exists within a context, the depth includes nesting from the
always-present html element and also the body, since currently the HTML
Processor only supports parsing in the IN BODY context.

This means that the depth reported for the `DIV` in `<div>` is 3, not 1, because
its breadcrumbs path is `HTML > BODY > DIV`.

Developed in https://github.com/WordPress/wordpress-develop/pull/6589
Discussed in https://core.trac.wordpress.org/ticket/61255

Fixes #61255.
Props dmsnell, jonsurrell.

Built from https://develop.svn.wordpress.org/trunk@58191


git-svn-id: http://core.svn.wordpress.org/trunk@57654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 23:37:12 +00:00
dmsnell
c3b76697cd HTML API: Respect class_name query arg in HTML_Processor::next_tag()
Previously the HTML Process was ignoring the `class_name` argument in
the `next_tag()` query if it existed. This was wrong and would lead to
calling code finding the wrong tag if provided.

This patch adds the class detection code back into `next_tag()` to fix
the bug.

Developed in https://github.com/WordPress/wordpress-develop/pull/6618
Discussed in https://core.trac.wordpress.org/ticket/58517

See #58517.
Follow-up to [56274].
Props: dmsnell, jonsurrell.

Built from https://develop.svn.wordpress.org/trunk@58190


git-svn-id: http://core.svn.wordpress.org/trunk@57653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 22:45:13 +00:00
ellatrix
3c2e6808c3 Editor: add new block PHP files.
This was forgotten in changeset 58187.


Built from https://develop.svn.wordpress.org/trunk@58189


git-svn-id: http://core.svn.wordpress.org/trunk@57652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 19:59:07 +00:00
dmsnell
cbc1c955d8 Introduce Token Map: An optimized static translation class.
This patch introduces a new class: `WP_Token_Map`, designed for efficient
lookup and translation of static mappings between string keys or tokens, and
string replacements (for example, HTML character references).

The Token Map imposes certain restrictions on the byte length of the lookup
tokens and their replacements, but is a highly-optimized data structure for
mappings with a very high number of tokens.

Developed in https://github.com/WordPress/wordpress-develop/pull/5373
Discussed in https://core.trac.wordpress.org/ticket/60698

Fixes #60698.
Props: dmsnell, gziolo, jonsurrell, jorbin.

Built from https://develop.svn.wordpress.org/trunk@58188


git-svn-id: http://core.svn.wordpress.org/trunk@57651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 19:56:08 +00:00
ellatrix
1fbf5fa51d Editor: Update npm packages.
Updates the editor npm packages to latest versions.

See https://github.com/WordPress/wordpress-develop/pull/6612.

Props ellatrix, mukesh27, youknowriad, mamaduka.


Built from https://develop.svn.wordpress.org/trunk@58187


git-svn-id: http://core.svn.wordpress.org/trunk@57650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 19:39:28 +00:00
Bernhard Reiter
031dbe0b4d Block Hooks API: Insert metadata at the same time as hooked blocks.
The Block Hooks UI relies on the `ignoredHookedBlocks` metadata when determining whether to show the toggle in the Site Editor. The problem is that for uncustomized templates we don't add this metadata.

Currently the visitor functions have a default callback of `insert_hooked_blocks` and we only add the metadata when we're writing to the database via an available filter in the template controller.

This changeset creates a new callback which both inserts the hooked blocks and adds the `ignoredHookedBlocks` metadata to the anchor block, and uses this new callback explicitly in the visitor functions that are run upon reading from the database.

We continue to set the `ignoredHookedBlocks` metadata when writing to the database, i.e. this operation happens twice. Although not ideal, this is necessary to cover the following scenarios:

* When the user adds an anchor block within the editor, we still need to add the `ignoredHookedBlocks` meta to it to prevent hooked blocks hooking on to it unexpectedly on the frontend. This is required to keep parity between the frontend and editor.
* When a user writes template data to the database directly through the API (instead of the editor), we need to again ensure we're not inserting hooked blocks unexpectedly.

It is worth noting that with this change, the first hooked block to insert relative to its anchor block will be accepted. Any additional blocks of the same type (e.g. a second `core/loginout` block) trying to hook onto the same anchor block will be ignored, irrespective of the position.

Props tomjcafferkey, bernhard-reiter, gziolo.
Fixes #59574.
Built from https://develop.svn.wordpress.org/trunk@58186


git-svn-id: http://core.svn.wordpress.org/trunk@57649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 18:35:14 +00:00
Joe McGill
bdebc89143 Editor: Remove additional calls to WP_Theme_JSON::_construct.
This improves performance of the  `WP_Theme_JSON_Resolver` class by avoiding redundant construction of `WP_Theme_JSON` objects for each origin.

Props thekt12, joemcgill, swissspidy, audrasjb, oandregal.
Fixes #61112.

Built from https://develop.svn.wordpress.org/trunk@58185


git-svn-id: http://core.svn.wordpress.org/trunk@57648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 16:14:13 +00:00
Sergey Biryukov
0d6e7f33c4 Editor: Add excerpt support to the wp_block post type.
The purpose is to enable using the excerpt as a description for user-created patterns on the Site Editor Pattern screens.

This commit backports the original PR from Gutenberg repository:
* [[https://github.com/WordPress/gutenberg/pull/60549|#60549: [Data Views] User patterns: Use excerpt as description]]

Reference: [[https://github.com/WordPress/gutenberg/issues/55244|#55244: Patterns: Add descriptions to user-created patterns]].

Follow-up to [44146], [44150], [50835], [56030].

Props poena, ntsekouras, krupalpanchal.
Fixes #61250.
Built from https://develop.svn.wordpress.org/trunk@58184


git-svn-id: http://core.svn.wordpress.org/trunk@57647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-23 13:41:58 +00:00
Sergey Biryukov
6cb9583d5d Tests: Use assertSame() in navigation fallback tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [56052].

See #60705.
Built from https://develop.svn.wordpress.org/trunk@58183


git-svn-id: http://core.svn.wordpress.org/trunk@57646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-22 15:41:11 +00:00
spacedmonkey
0775b69427 Options, Meta APIs: Introduce wp_prime_network_option_caches() to load multiple network options with a single database request.
WordPress's `get_network_option` function generally makes individual database requests for each network option. While some options are preloaded in `wp_load_core_site_options`, many still require single database calls to the network options table.

Building on the work done in [56445], [56990], and [57013], which introduced the `wp_prime_option_caches` function, this commit adds two new functions: `wp_prime_network_option_caches` and `wp_prime_site_option_caches`. These functions enable developers to pass an array of option names, allowing caches for these options to be primed in a single object cache or database request. If an option is not found, the notoptions cache key is refreshed, preventing unnecessary repeated requests.

The function `wp_prime_site_option_caches` is similar to `get_site_option`, enabling developers to retrieve network options on the current network without needing to know the current network ID. If these functions are called in a non-multisite environment, they fall back to using wp_prime_option_caches.

These functions have been implemented in `wp_load_core_site_options`, `get_site_transient`, and `set_site_transient`.

Props to spacedmonkey, peterwilsoncc, mukesh27, joemcgill.
Fixes #61053.
Built from https://develop.svn.wordpress.org/trunk@58182


git-svn-id: http://core.svn.wordpress.org/trunk@57645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-21 21:38:12 +00:00
Sergey Biryukov
b6b5ffbf9f Tests: Use assertSame() in block support tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Includes renaming a few test classes per the naming conventions.

Reference: [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization Writing PHP Tests: Naming and Organization].

Follow-up to [53076], [53085], [54497], [56046], [56614], [57246], [57491].

See #60705.
Built from https://develop.svn.wordpress.org/trunk@58181


git-svn-id: http://core.svn.wordpress.org/trunk@57644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-21 10:33:13 +00:00
spacedmonkey
90de126bd5 Query: Add more context to the split_the_query filter.
Add more context to the `split_the_query` filter by adding two new parameters: '$old_request' and '$clauses'. This enriches the filter with additional information about the SQL query before the query is run, enabling developers to have more context to help decide if a query should be split. 

Props spacedmonkey, shailu25, rcorrales, tillkruess.
Fixes #59514.
Built from https://develop.svn.wordpress.org/trunk@58180


git-svn-id: http://core.svn.wordpress.org/trunk@57643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-20 21:21:16 +00:00
Tammie Lister
73bb34454d Twenty Twenty-Three: Updates Screenshot.
The screenshot wasn't showing the front view. This now resolves it to fit guidelines. 

Props kafleg, poena, shivashankerbhatta, SergeyBiryukov.
Fixes #56949.

Built from https://develop.svn.wordpress.org/trunk@58179


git-svn-id: http://core.svn.wordpress.org/trunk@57642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-20 17:49:17 +00:00
Tammie Lister
cd0b1dde3c Bundled Themes: Removes measurement in px for zero and related fixes.
The measurement in px for zero values is not needed. It does this for Twenty Twenty-One, Twenty Ten, Twenty Eleven and Twenty Nineteen. This also adds short-hand-property-no-redudant-values to Twenty Twenty-One's stylelint rules. Included is removing box-shadow prefixed rules before the standard property in Twenty Ten. Finally, it also removes empty spaces at the ends of lines in Twenty Thirteen, Twenty Nineteen and Twenty Twenty. 

Props ankitmaru, SergeyBiryukov, netweb, mukesh27, ryelle, audrasjb, sabernhardt.
Fixes #53874.

Built from https://develop.svn.wordpress.org/trunk@58178


git-svn-id: http://core.svn.wordpress.org/trunk@57641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-20 15:14:16 +00:00