Skip to content

Commit

Permalink
Site Editor - prevent loading state from showing the admin menu. (#36455
Browse files Browse the repository at this point in the history
)

* start with is-fullscreen-mode class on the body

* only add filter if loading edit site page

* remove unnecessary static prefix

* Update lib/full-site-editing/edit-site-page.php
  • Loading branch information
Addison-Stavlo authored and andrewserong committed Nov 16, 2021
1 parent 7428bd6 commit 6229382
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/full-site-editing/edit-site-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ function gutenberg_edit_site_init( $hook ) {
return;
}

// Default to is-fullscreen-mode to avoid rendering wp-admin navigation menu while loading and
// having jumps in the UI.
add_filter(
'admin_body_class',
static function( $classes ) {
return "$classes is-fullscreen-mode";
}
);

/**
* Make the WP Screen object aware that this is a block editor page.
* Since custom blocks check whether the screen is_block_editor,
Expand Down

0 comments on commit 6229382

Please sign in to comment.