Commit Graph

8 Commits

Author SHA1 Message Date
Sergey Biryukov 5c4f902c20 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.
Built from https://develop.svn.wordpress.org/trunk@56793


git-svn-id: http://core.svn.wordpress.org/trunk@56305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-06 14:06:22 +00:00
Sergey Biryukov e5490118af Coding Standards: Include one space after `function` keyword for closures.
Note: This is enforced by WPCS 3.0.0.

Reference: [https://github.com/WordPress/WordPress-Coding-Standards/pull/2328 WPCS: PR #2328 Core: properly check formatting of function declaration statements].

Props jrf.
See #59161, #58831.
Built from https://develop.svn.wordpress.org/trunk@56559


git-svn-id: http://core.svn.wordpress.org/trunk@56071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-12 15:23:18 +00:00
hellofromTonya 87aa505a94 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.
Fixes #58823.
Built from https://develop.svn.wordpress.org/trunk@56422


git-svn-id: http://core.svn.wordpress.org/trunk@55934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-08-21 17:51:19 +00:00
John Blackbourn 4667b9323f Docs: Miscellaneous docblock corrections and improvements.
See #58833

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


git-svn-id: http://core.svn.wordpress.org/trunk@55926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-08-18 17:29:20 +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