Commit Graph

5230 Commits

Author SHA1 Message Date
Isabel Brison
2beefda2c0 Editor: trim footnote anchors from post excerpts.
Adds the `excerpt_remove_footnotes` function to trim footnote anchors from post excerpts.

Props: ramonopoly, costdev, mukesh27, mcsf, azaozz.
Fixes #58805.


git-svn-id: https://develop.svn.wordpress.org/trunk@56244 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-17 01:45:24 +00:00
Sergey Biryukov
de6f51823a Tests: Add tests to ensure the contribute Toolbar node is added when appropriate.
Follow-up to [56220].

Props costdev.
See #23348.

git-svn-id: https://develop.svn.wordpress.org/trunk@56227 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-13 12:39:42 +00:00
Jonny Harris
fc538206ec Editor: Lazily load Duotone settings only when needed.
Introduced in [56101] the `WP_Duotone` class, hooks into the `wp_loaded` action to load duotone style data from global styles. Hooking in early in the bootstrap process caused a number of problems. This hook, triggered an error on installing, as this lookup for global styles, would result in a global post trying to be created, even before the table existed. Additionally, this implementation caused a severe performance regression, as duotone styling data was loaded unnecessarily for requests that did not require such data, such as REST API calls or actions within the wp-admin interface.

In this change, refactor the `WP_Duotone` to lazily load the global styles and theme.json data, only when a block that supports duotone is encountered. The method `render_duotone_support` was change to take a third parameter to reuse the existing `WP_Block_Type` object passed to the filter, to save it being looked up again. The code has also got improved type checking and the use of the util function  `block_has_support`. Furthermore, the code's readability has been improved, along with enhancements to the documentation blocks.

Props Chouby, spacedmonkey, SergeyBiryukov, swissspidy, costdev, joemcgill, flixos90, mukesh27, nazmul111, ajlende, isabel_brison.
Fixes #58673.

git-svn-id: https://develop.svn.wordpress.org/trunk@56226 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-13 11:32:19 +00:00
Peter Wilson
65a048fc15 General: Introduce all development mode.
Introduce the development mode `all` as a a cover-all mode for the existing `theme`, `plugin` and `core` development modes. Developers can use the `all` mode if they are developing both themes and plugins, for example.

Introduce the utility function `wp_in_development_mode()` allowing developers to detect the mode via a parameter. If the development mode is set to `all` this function will always return `true`. If the development mode is specific then only the chosen mode will return `true`.

Follow up to [56079,56042].

Props flixos90.
Fixes #57487.



git-svn-id: https://develop.svn.wordpress.org/trunk@56223 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-13 00:27:06 +00:00
Sergey Biryukov
cdf3ac093d Coding Standards: Use single quotes for a string in Tests_Comment.
This resolves a WPCS error:
{{{
Error: String "1" does not require double quotes; use single quotes instead.
}}}

Includes updating a few related comments for clarity.

Follow-up to [56221].

See #57855.

git-svn-id: https://develop.svn.wordpress.org/trunk@56222 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-12 20:59:37 +00:00
Aaron Jorbin
434dd6be91 Tests: Use assertSame() in Tests_Comment
See #57855.


git-svn-id: https://develop.svn.wordpress.org/trunk@56221 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-12 20:04:02 +00:00
Joe McGill
ed174730d3 Media: Optimize images created in shortcodes.
This fixes an issue where images dynamically created during shortcode rendering (e.g., shortcode image galleries), were not getting image optimizations like `loading="lazy"` or `fetchpriority="hight"` applied. Note that even after this commit, shortcodes are processed after the main content images, which can affect the order in which optimizations are applied in content areas.

Follow-up to [56037].

Props spacedmonkey, flixos90, thekt12, swissspidy, joemcgill.
Fixes #58681.


git-svn-id: https://develop.svn.wordpress.org/trunk@56214 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-11 13:56:55 +00:00
Joe McGill
cb54fdb142 Build/Test Tools: Reset main query object after each test.
This resets the main query variable, `$wp_the_query` during the `WP_UnitTestCase_Base::tear_down` method that runs after each PHPUnit test. This ensures any changes to the main query object is reset after each test to avoid cross contamination between tests, similar to how other globals are reset.

Props flixos90, spacedmonkey, joemcgill.
Fixes #58776.


git-svn-id: https://develop.svn.wordpress.org/trunk@56212 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-11 13:31:03 +00:00
Isabel Brison
a02886a868 Editor: opt out of Navigation fallback.
Allows developers to opt out of the auto-creation of the Navigation fallback through a filter.

Props get_dave, spacedmonkey, ramonopoly.
Fixes #58750.


git-svn-id: https://develop.svn.wordpress.org/trunk@56202 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-11 05:39:33 +00:00
Andrew Ozz
8b8afa1299 Filesystem API: Ensure wp_tempnam() does not produce file names longer than 255 characters as this is the limit on most filesystems.
Props: costdev, doems, mikeschroder, oglekler, mrinal013.
Fixes: #35755.

git-svn-id: https://develop.svn.wordpress.org/trunk@56186 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-10 20:31:35 +00:00
Felix Arntz
96c64cd42d Media: Avoid programmatically created images within post content from incorrectly receiving fetchpriority="high".
Follow-up to [56037], as that changeset accidentally did not consider the changes made in [55825]: Images that are programmatically injected into post content (e.g. through a block, or shortcode, or any hook calling a function like `wp_get_attachment_image()`) must be treated as part of the whole post content blob since otherwise the heuristics for applying `fetchpriority="high"` and `loading="lazy"` are skewed by parsing certain images before others rather than sequentially parsing the entire post content. [55825] addressed that for lazy-loading, but when [56037] introduced `fetchpriority` support, the related refactor missed making the same consideration for that attribute.

Props flixos90, spacedmonkey, thekt12, mukesh27.
Fixes #58235.
See #58089.


git-svn-id: https://develop.svn.wordpress.org/trunk@56164 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 18:06:49 +00:00
Adam Silverstein
9781ffbca5 Revisions: return existing autosave after saving with unchanged data.
Correctly return the existing autosave when an unchanged autosave is saved, instead of returning an error.

Fix regressions after r55154 where an error and not the original autosave was returned when saving with unchanged data (for example, clicking the preview button repeatedly). Returning the autosave (ID) is the expected behavior for the endpoint.

Follow up to [55154]

Props Mamaduka, jeroenrotty, mrfoxtalbot.
Fixes #58739.



git-svn-id: https://develop.svn.wordpress.org/trunk@56163 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 17:51:11 +00:00
Jonny Harris
2fbf610b25 Build/Test: Fix dynamic property deprecation warning in object cache drop-in.
Fix deprecation warning for dynamic property in object cache drop-in used in core unit tests. 

Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

Props spacedmonkey, johnbillion.
Fixes #58736. 
See #56034.

git-svn-id: https://develop.svn.wordpress.org/trunk@56161 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 11:30:15 +00:00
Isabel Brison
7035b615c4 Editor: rename sync_status and move it to top level.
Renames sync_status to wp_pattern_sync_status and moves it to top level field of wp_block post type.

Props glendaviesnz, aaronrobertshaw, mukesh27, peterwilsoncc.
Fixes 58677.


git-svn-id: https://develop.svn.wordpress.org/trunk@56160 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-07 07:27:53 +00:00
Felix Arntz
21490c6ba4 Media: Ensure that the image widget supports loading optimization attributes.
This changeset adds support for loading optimization attributes such as `loading="lazy"` and `fetchpriority="high"` to the image widget. A new context `widget_media_image` is introduced for that purpose.

Props spacedmonkey, thekt12, mukesh27, westonruter.
Fixes #58704.
See #58235.


git-svn-id: https://develop.svn.wordpress.org/trunk@56154 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 16:31:02 +00:00
Isabel Brison
9d141e5a5e Editor: update template titles in browse mode.
Adds more meaningful titles to templates in the browse mode template list.

Props ntsekouras, audrasjb.
Fixes #58713.


git-svn-id: https://develop.svn.wordpress.org/trunk@56145 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-06 03:02:57 +00:00
Felix Arntz
ebd03692e6 Media: Ensure that large images before the main query loop are counted towards lazy-loading threshold.
Following [55318], [55847], and [56142], certain images in the header of the page have received support for potentially receiving `fetchpriority="high"` and having the `loading="lazy"` attribute omitted. However, these images being present did not affect the "content media count" which counts the images towards a certain threshold so that the first ones are not lazy-loaded.

This changeset also increases that count for such header images if they are larger than a certain threshold. The threshold is used to avoid e.g. a header with lots of small images such as icon graphics to skew the lazy-loading behavior.

Props thekt12, spacedmonkey, flixos90.
Fixes #58635.


git-svn-id: https://develop.svn.wordpress.org/trunk@56143 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 21:36:23 +00:00
Felix Arntz
aee525ee6f Media: Ensure custom header image tag supports loading optimization attributes.
This changeset is a follow up to [56037] and ensures that the `get_header_image_tag()` function receives the benefits of `wp_get_loading_optimization_attributes()` as well. Prior to `fetchpriority` support, this was not needed since the header image should never be lazy-loaded, but the image certainly is a `fetchpriority` candidate, so therefore it is crucial to have it supported.

Props felipeelia, spacedmonkey, mukesh27, westonruter, flixos90.
Fixes #58680.


git-svn-id: https://develop.svn.wordpress.org/trunk@56142 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 19:28:02 +00:00
John Blackbourn
f7dbb2462b General: Increase the minimum supported version of PHP to 7.0.0.
This also removes the random compat library which is no longer necessary, and adjusts unit tests and CI workflows that no longer need to take PHP 5.6 into account.

Thank you for your service, PHP 5. Onwards!

Props SergeyBiryukov, mukesh27, dingo_d, audrasjb, jrf, costdev, azaozz, JavierCasares, hellofromTonya, samiamnot, spacedmonkey, masteradhoc, knutsp, garyjones, chanthaboune

Fixes #57345


git-svn-id: https://develop.svn.wordpress.org/trunk@56141 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 17:39:55 +00:00
Sergey Biryukov
c11f70878f General: Compare values as strings in WP_List_Util::filter() and ::sort_callback().
This aims to preserve backward compatibility for code relying on type juggling when using the `wp_list_filter()` function, e.g. comparing a numeric string to an integer.

Follow-up to [55908].

Props azaozz, jeremyfelt, david.binda.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@56137 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 10:44:20 +00:00
Andrew Ozz
56af1e4b94 HTML API: Fix a fatal error when processing malformed document with unclosed attribute.
Props: dlh, costdev, dmsnell.
Fixes: #58637.

git-svn-id: https://develop.svn.wordpress.org/trunk@56133 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-04 20:43:43 +00:00
Sergey Biryukov
e834fed6eb Options, Meta APIs: Check if the gmt_offset value is numeric in sanitize_option().
When saving the settings via the admin UI, the default value for any options not passed in the current `$_POST` request is set to `null` in `wp-admin/options.php`. Some options, e.g. `blog_public`, then rely on `null` being passed to `update_option()` to determine whether the value was changed or not.

This commit resolves a PHP 8.1 deprecation notice when saving the `gmt_offset` option without any changes:
{{{
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}

Includes a similar fix for the `blog_charset` option.

Follow-up to [4112], [4329], [5541], [21849].

Props adi3890, dhrupo, hrdelwar, hasanmisbah, oglekler, mukesh27, SergeyBiryukov.
Fixes #57728.

git-svn-id: https://develop.svn.wordpress.org/trunk@56132 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-04 13:40:55 +00:00
Sergey Biryukov
62b286f9b2 Upgrade/Install: Initialize the local $checkout variable in WP_Automatic_Updater::is_vcs_checkout().
This avoids an `Undefined variable $checkout` PHP warning if all of the directories checked for access are disallowed due to the PHP `open_basedir` restrictions.

Follow-up to [55425].

Props jqz, costdev, audrasjb.
Fixes #58563.

git-svn-id: https://develop.svn.wordpress.org/trunk@56124 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-02 10:33:18 +00:00
Jb Audras
e635540d1c Quick/Bulk Edit: Ensure scheduled posts are published when using Bulk Edit.
This changeset ensures scheduled posts are actually published when changing their status to "Published" using bulk edit. Also adds related unit tests.

Props siobhan, Clorith, webcommsat, cadic, oglekler, audrasjb, pavanpatil1.
Fixes #31635.




git-svn-id: https://develop.svn.wordpress.org/trunk@56123 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-02 08:02:45 +00:00
John Blackbourn
be90d79cb5 General: Ignore invalid types for the '_wp_http_referer' URL query variable.
It's expected that this query variable contains a string when it's set, but it's possible for its type to be something else such as an array. Ignoring non-string values prevents cascading errors when its value is passed through functions that expect a string.

Props xknown, costdev, jrf, azaozz

Fixes #57670


git-svn-id: https://develop.svn.wordpress.org/trunk@56115 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 23:25:38 +00:00
Isabel Brison
41277f1f1b REST API: updates test annotations for global styles revisions
Adds `@covers` annotations to tests and fixes incorrect spacing.

Props ramonopoly, mukesh27.
See #58524.


git-svn-id: https://develop.svn.wordpress.org/trunk@56105 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 06:47:43 +00:00
Isabel Brison
280f162097 Editor: delete test file from update duotone support.
Deleting the test file that should have been removed in [56101].

See #58555.


git-svn-id: https://develop.svn.wordpress.org/trunk@56103 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 06:34:25 +00:00
Isabel Brison
d966798bfc Editor: update duotone support.
Updates duotone support after stabilisation of selectors API and adds a few small code quality and UI improvements.

Props onemaggie, peterwilsoncc, ajlende, audrasjb, mikeschroder, ramonopoly.
Fixes #58555.


git-svn-id: https://develop.svn.wordpress.org/trunk@56101 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-29 06:19:41 +00:00
K. Adam White
68be569925 REST API: Expose current $request object to cors_header filters in WP_REST_SERVER->serve_request().
Allows headers to be more easily set on a per-response basis when more or less security is needed on a specific route.

Props bor0, rachelbaker, spacedmonkey, chaion07, oglekler, SergeyBiryukov.
Fixes #57752.



git-svn-id: https://develop.svn.wordpress.org/trunk@56096 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 17:37:52 +00:00
Andrew Ozz
80e424ad55 Script Loader: Fix unintended adding of async to scripts that are printed directly with wp_print_scripts() without enqueueing them beforehand.
Props: joemcgill, westonruter, felixarntz, peterwilsoncc.
See: #58648.

git-svn-id: https://develop.svn.wordpress.org/trunk@56092 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 14:14:58 +00:00
Sergey Biryukov
a63be5a890 Quick/Bulk Edit: Add an action hook to bulk_edit_posts() function.
This changeset introduces the `bulk_edit_posts` action hook, triggered after processing the post data for bulk edit and before the function returns its results. For example, it allows developers to save additional data without having to perform any `.ajax()` calls.

Follow-up to [8973].

Props helgatheviking, helen, Mte90, afercia, mrasharirfan, desrosj, itowhid06, pento, mensmaximus, audrasjb, costdev, webcommsat, marybaum, oglekler, mukesh27, SergeyBiryukov.
Fixes #28112.

git-svn-id: https://develop.svn.wordpress.org/trunk@56091 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 13:17:49 +00:00
Isabel Brison
28c879ecc4 Editor: update function name in test comment.
Renames `gutenberg_apply_typography_support` to `wp_apply_typography_support` in typography test comment.

Props kebbet, oglekler, ramonopoly.
See #58522.


git-svn-id: https://develop.svn.wordpress.org/trunk@56084 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 03:56:48 +00:00
Isabel Brison
518a4fc53c Editor: add Post Template fallback styles.
Adds fallback styles necessary for classic themes to display the correct Post Template layout.

Props mikeschroder, ramonopoly.
Fixes #58570.


git-svn-id: https://develop.svn.wordpress.org/trunk@56083 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 03:47:17 +00:00
Isabel Brison
c345180c29 REST API: add revisions endpoint for global styles.
Adds an endpoint that returns revisions to the global styles custom post.

Props ramonopoly, peterwilsoncc, spacedmonkey, mukesh27, timothyblynjacobs.
Fixes #58524.


git-svn-id: https://develop.svn.wordpress.org/trunk@56082 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-28 03:33:23 +00:00
K. Adam White
507cab8d6f REST API: Check post meta update authorization only when value is changed.
Resolves a bug where a post save will be reported as failed if the post includes any meta keys the current user does not have authorization to update, even when those meta values are unchanged.
Write authorization is now checked for a meta key only when the value of that key has changed, so that passing a REST response back unchanged will not cause failures.
Authorization is only needed when data will be updated.

Props ckoerner, TimothyBlynJacobs, spacedmonkey



git-svn-id: https://develop.svn.wordpress.org/trunk@56075 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 17:24:44 +00:00
Sergey Biryukov
87a0ad45a5 Media: Only show “Copy” and “Download” actions when an attachment URL is available.
Includes unit tests to verify the logic for displaying row actions in the Media Library in certain scenarios, e.g. with and without the “Trash” or “Unattached” filter.

Follow-up to [55949].

Props costdev, kebbet, mukesh27, oglekler.
Fixes #57893.

git-svn-id: https://develop.svn.wordpress.org/trunk@56072 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 16:26:15 +00:00
Jb Audras
7ce266f2b2 Coding Standards: Fix a PHPCS issue found in wpPluginsListTable.php.
This fixes a previously existing issue, discovered after [56068].




git-svn-id: https://develop.svn.wordpress.org/trunk@56070 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 16:09:19 +00:00
Mike Schroder
45b080dd54 Filesystem API: Allow optional inclusion of hidden files in list_files().
Adds a new optional `$include_hidden` parameter to allow the inclusion of hidden (`.` prefixed) files.
Defaults to false for backward compatibility.

Props yani.iliev, sabernhardt, costdev, rutviksavsani, zunaid321, azaozz.
Fixes #53659.

git-svn-id: https://develop.svn.wordpress.org/trunk@56069 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 16:06:16 +00:00
Jb Audras
929c270cf9 Plugins: Introduce the plugins_list filter.
This changeset adds the `plugins_list` hook, which can be use to filter the list of plugin displayed on WP Admin Plugins screen.

Props nateallen, fischfood, mukesh27, peterwilsoncc, SergeyBiryukov, audrasjb, costdev, ecorica, zunaid321.
Fixes #57278.




git-svn-id: https://develop.svn.wordpress.org/trunk@56068 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 16:00:00 +00:00
Jb Audras
b66fcb55e5 Menus: Allow themes and plugins to pass HTML attributes to various Nav Walker outputs.
This introduces a new set of hooks that can be used to filter various HTML elements of the Nav Walker, in order to output the desired HTML attributes:

- List items: `nav_menu_item_attributes`
- Submenu `<ul>` element: `nav_menu_submenu_attributes`

Props davidwebca, danyk4, costdev, peterwilsoncc, audrasjb, oglekler.
Fixes #57140.




git-svn-id: https://develop.svn.wordpress.org/trunk@56067 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 15:25:00 +00:00
Bernie Reiter
a710b97e7c Editor: update Wordpress npm packages.
Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.

Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes #58623.

git-svn-id: https://develop.svn.wordpress.org/trunk@56065 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 14:20:18 +00:00
Jonny Harris
30d6172eed Script Loader: Fix performance issues in wp_common_block_scripts_and_styles.
In [52069] the function `wp_common_block_scripts_and_styles` was changed load individual theme stylesheets, if the current theme supports block styles and loading separate core block assets. To do this, the function calls many expensive file operation functions, such as `glob`, `file_exists` and `file_get_contents`. This is wasteful, as these functions are loaded on every page request, even request that do not include blocks, like REST API calls. In [56044] all core block styles are registered in a single place. In `register_core_block_style_handles` calls `glob` to get all css styles in block directories. While registering style and editor styles, also register block theme styles, under a new style handle. Example `wp-block-avatar-theme`. If the current theme supports block styles, also request the block to enqueue the theme style on the front end. As these new stylesheets have a path attribute set, the function `wp_maybe_inline_styles` will automatically inline the styles for you. 

Props spacedmonkey, flixos90, oandregal, costdev, audrasjb, mukesh27.
Fixes #58560.

git-svn-id: https://develop.svn.wordpress.org/trunk@56064 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 11:26:12 +00:00
Isabel Brison
c27f776a6a Editor: allow filtering block patterns by source.
Extends the REST API endpoint for block patterns to provide a source attribute that can be used to filter patterns.

Props aaronrobertshaw, mukesh27, talldanwp, ramonopoly.
Fixes 58622.


git-svn-id: https://develop.svn.wordpress.org/trunk@56063 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 11:11:02 +00:00
Isabel Brison
8b9d8d8a9f Editor: refactor and stabilize selectors API.
Restructures the block.json selectors API by moving `__experimentalSelector` props into their own config, stabilizing the selectors API, and enabling more flexible styling options.

Props ramonopoly, spacedmonkey, aaronrobertshaw, onemaggie.
Fixes #58586.


git-svn-id: https://develop.svn.wordpress.org/trunk@56058 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 08:46:45 +00:00
Isabel Brison
7e9385e485 Editor: stabilise layout and refactor definitions.
Marks the layout support stable and moves layout definitions from `theme.json` into `wp-includes/block-supports/layout.php`.

Props andrewserong, poena, ramonopoly, peterwilsoncc.
Fixes #58550.


git-svn-id: https://develop.svn.wordpress.org/trunk@56055 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 07:23:04 +00:00
Isabel Brison
7c4c4a8665 Editor: fix post edit navigation link.
Adds a custom link for navigation post types.

Props get_dave, spacedmonkey, ramonopoly.
Fixes #58589.


git-svn-id: https://develop.svn.wordpress.org/trunk@56053 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 06:00:59 +00:00
Isabel Brison
3d551af3f2 Editor: add navigation fallback.
Creates a fallback menu for the Navigation block including an API endpoint to retrieve it.

Props get_dave, spacedmonkey, kebbet, flixos90, mikeschroder, ramonopoly, audrasjb.
Fixes 58557.


git-svn-id: https://develop.svn.wordpress.org/trunk@56052 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 05:52:06 +00:00
Isabel Brison
a44e46b914 REST API: ignore empty templates.
Ignore empty templates when using the `/lookup` endpoint in the `WP_REST_Templates_Controller` class.

Props ramonopoly, jorgefilipecosta, spacedmonkey, youknowriad, mukesh27.
Fixes #58615.



git-svn-id: https://develop.svn.wordpress.org/trunk@56051 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-27 05:34:12 +00:00
Isabel Brison
e55e9c2f0c Editor: add box shadow support to blocks.
Adds the ability for blocks to declare support for CSS box-shadow and processing of necessary styles.

Props madhudollu, sabernhardt, ramonopoly, spacedmonkey, mukesh27.
Fixes #58590.


git-svn-id: https://develop.svn.wordpress.org/trunk@56046 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-26 23:42:16 +00:00
Jonny Harris
d8409a205a Editor: Register core block styles in one place.
Register all core blocks in a new function called `register_core_block_style_handles`. This mirrors the function `wp_default_styles` where all core styles are registered in one place. This improves block registration performance, as it avoids expensive file lookups, like realpath in `register_block_style_handle`. The new function `register_core_block_style_handles` uses `glob` to get all css files in the blocks directory. This glob is cached in a transient to save lookups on subsequent requests. The function `register_block_style_handle` now checks to see if the style handle is already registered before trying to register it again. 

Props mukesh27, westonruter, flixos90, joemcgill, spacedmonkey.
Fixes #58528.

git-svn-id: https://develop.svn.wordpress.org/trunk@56044 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-26 21:15:21 +00:00