[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
WP_Navigation_Fallback class Manages fallback behavior for Navigation menus.
File Size: | 303 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
WP_Navigation_Fallback:: (10 methods):
update_wp_navigation_post_schema()
get_fallback()
get_most_recently_published_navigation()
create_classic_menu_fallback()
get_fallback_classic_menu()
get_most_recently_created_nav_menu()
get_nav_menu_with_primary_slug()
get_nav_menu_at_primary_location()
create_default_fallback()
get_default_fallback_blocks()
Class: WP_Navigation_Fallback - X-Ref
Manages fallback behavior for Navigation menus.update_wp_navigation_post_schema( $schema ) X-Ref |
Updates the wp_navigation custom post type schema, in order to expose additional fields in the embeddable links of WP_REST_Navigation_Fallback_Controller. The Navigation Fallback endpoint may embed the full Navigation Menu object into the response as the `self` link. By default, the Posts Controller will only expose a limited subset of fields but the editor requires additional fields to be available in order to utilize the menu. Used with the `rest_wp_navigation_item_schema` hook. return: array The modified schema. param: array $schema The schema for the `wp_navigation` post. |
get_fallback() X-Ref |
Gets (and/or creates) an appropriate fallback Navigation Menu. return: WP_Post|null the fallback Navigation Post or null. |
get_most_recently_published_navigation() X-Ref |
Finds the most recently published `wp_navigation` post type. return: WP_Post|null the first non-empty Navigation or null. |
create_classic_menu_fallback() X-Ref |
Creates a Navigation Menu post from a Classic Menu. return: int|WP_Error The post ID of the default fallback menu or a WP_Error object. |
get_fallback_classic_menu() X-Ref |
Determines the most appropriate classic navigation menu to use as a fallback. return: WP_Term|null The most appropriate classic navigation menu to use as a fallback. |
get_most_recently_created_nav_menu( $classic_nav_menus ) X-Ref |
Sorts the classic menus and returns the most recently created one. return: WP_Term The most recently created classic nav menu. param: WP_Term[] $classic_nav_menus Array of classic nav menu term objects. |
get_nav_menu_with_primary_slug( $classic_nav_menus ) X-Ref |
No description |
get_nav_menu_at_primary_location() X-Ref |
Gets the classic menu assigned to the `primary` navigation menu location if it exists. return: WP_Term|null The classic nav menu assigned to the `primary` location or null. |
create_default_fallback() X-Ref |
Creates a default Navigation Block Menu fallback. return: int|WP_Error The post ID of the default fallback menu or a WP_Error object. |
get_default_fallback_blocks() X-Ref |
Gets the rendered markup for the default fallback blocks. return: string default blocks markup to use a the fallback. |
Generated : Sat Nov 23 08:20:01 2024 | Cross-referenced by PHPXref |