Commit Graph

5 Commits

Author SHA1 Message Date
audrasjb
544ca05b84 Editor: Fix error handling of converting classic to block menus.
Fixes the error handling for when `WP_Classic_To_Block_Menu_Converter::convert()` returns an instance of `WP_Error`. 
`WP_Navigation_Fallback::create_classic_menu_fallback()` now checks for `is_wp_error()` and if `true`, returns the error. And the `@return` type is updated to 
`string|WP_Error`.

Also includes a fix in the return type in `WP_Classic_To_Block_Menu_Converter::convert()` to return an empty string instead of an array instead, i.e. when bailing 
out for no menu items returned by `wp_get_nav_menu_items()`. The return type is clearly documented as a string.

Follow-up to [56052].

Props dlh, get_dave, antonvlasenko, hellofromTonya.
Reviewed by azaozz, audrasjb.
Merges [56422] to the 6.3 branch.
Fixes #58823.

 --Cette ligne, et les suivantes ci-dessous, seront 
ignorées--

_M   .
M    src/wp-includes/class-wp-classic-to-block-menu-converter.php
M    src/wp-includes/class-wp-navigation-fallback.php
M    tests/phpunit/tests/editor/classic-to-block-menu-converter.php

Built from https://develop.svn.wordpress.org/branches/6.3@56426


git-svn-id: http://core.svn.wordpress.org/branches/6.3@55938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-08-22 20:59:24 +00:00
audrasjb
26395d827e Docs: Various docblocks corrections.
See #57840.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-18 07:37:21 +00:00
audrasjb
114ab18d18 Docs: Fix various incorrect @since mentions.
Props costdev, mukesh27.
Fixes #58834.
See #57840.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-18 07:30:23 +00:00
isabel_brison
b9dadf31a1 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-11 05:41:23 +00:00
isabel_brison
161b471f0b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 05:54:19 +00:00