mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-09 03:30:06 +00:00
Editor: Add Navigation Area infrastructure
Copies Navigation Area infrastrucutre from lib/navigation.php in Gutenberg. This allows a Navigation block to be associated with a particular area which persists when switching theme. Props antonvlasenko, mamaduka, spacedmonkey. See #54337. git-svn-id: https://develop.svn.wordpress.org/trunk@52145 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -59,7 +59,17 @@ $preload_paths = array(
|
||||
'/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit',
|
||||
'/wp/v2/global-styles/' . $active_global_styles_id,
|
||||
'/wp/v2/themes/' . $active_theme . '/global-styles',
|
||||
'/wp/v2/block-navigation-areas?context=edit',
|
||||
);
|
||||
|
||||
$areas = get_option( 'fse_navigation_areas', array() );
|
||||
$active_areas = array_intersect_key( $areas, get_navigation_areas() );
|
||||
foreach ( $active_areas as $post_id ) {
|
||||
if ( $post_id ) {
|
||||
$preload_paths[] = add_query_args( 'context', 'edit', rest_get_route_for_post( $post_id ) );
|
||||
}
|
||||
}
|
||||
|
||||
block_editor_rest_api_preload( $preload_paths, $block_editor_context );
|
||||
|
||||
$editor_settings = get_block_editor_settings(
|
||||
|
||||
Reference in New Issue
Block a user