Skip to content

Commit

Permalink
Limit to Site Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Mar 8, 2023
1 parent dde8068 commit b72b923
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/compat/wordpress-6.3/navigation-block-preloading.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
* @param array $preload_paths Preload paths to be filtered.
* @return array
*/
function gutenberg_preload_navigation_posts( $preload_paths ) {
function gutenberg_preload_navigation_posts( $preload_paths, $context ) {

// Limit to the Site Editor.
if ( ! empty( $context->name ) && 'core/edit-site' !== $context->name ) {
return $preload_paths;
}

$navigation_rest_route = rest_get_route_for_post_type_items(
'wp_navigation'
Expand Down

0 comments on commit b72b923

Please sign in to comment.