Skip to content

Instantly share code, notes, and snippets.

@stokesman
Created October 4, 2023 05:02
Show Gist options
  • Save stokesman/89b9066ec75f4ea74a6fadf43cf655a3 to your computer and use it in GitHub Desktop.
Save stokesman/89b9066ec75f4ea74a6fadf43cf655a3 to your computer and use it in GitHub Desktop.
Plugin to workaround gutenberg issue #53477
<?php
/**
* Plugin Name: Classic Block Resticky
* Description: Ensures the classic block’s formatting toolbar is sticky when custom fields are present.
*/
add_action( 'admin_footer', function() {
// Bails unless on a block editor screen
if ( ! get_current_screen()->is_block_editor() ) return;
?>
<style>
.has-metaboxes .edit-post-visual-editor { overflow: unset; }
/* Prevents overlap of formatting toolbar and the block toolbar */
.has-metaboxes .is-selected .block-library-classic__toolbar { top: 59px; }
</style>
<?php
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment