Switching Gutenberg to fullscreen mode requires setting to TRUE fullscreenMode
from the core/edit-post
package. To enqueue appropriate script, you use enqueue_block_editor_assets
action hook.
function se337302_fullscreen_editor()
{
$js_code = "jQuery(document).ready(function(){" .
" var isFullScreenMode = wp.data.select('core/edit-post').isFeatureActive('fullscreenMode');" .
" if ( !isFullScreenMode )" .
" wp.data.dispatch('core/edit-post').toggleFeature('fullscreenMode');" .
"});";
wp_add_inline_script( 'wp-blocks', $js_code );
}
add_action( 'enqueue_block_editor_assets', 'se337302_fullscreen_editor' );
Related Posts:
- Add To Gutenberg Sidebar
- How to detect the usage of Gutenberg
- Possible to use @wordpress/create-block with multiple blocks?
- What is the advantage of ‘register_block_type’ (the PHP function) when creating custom blocks?
- Extending Gutenberg group block: How to properly combine multiple attributes?
- Required (mandatory) Gutenberg block
- Add classname to Gutenberg block wrapper in the editor?
- How to develop custom blocks without triggering validation errors
- get selected categories or tags (using javascript) in GutenBerg?
- Help with using getBlockIndex
- Gutenberg blocks – processing server data within a block
- Best practices for CPT without using an editor [closed]
- Gutenberg – Custom blocks onClick not working?
- Get blocks from other pages, from within current page
- Your site doesn’t include support for the block… after registering a block
- Remove a component fill from a Block Editor panel
- How to wrap the Gutenberg editor in a custom React component?
- Proper way to reload or update getEntityRecords state
- Cannot embed YouTube video
- Add a button to the toolbar of an existing Gutenberg block
- JSON File in Gutenberg
- Show date post published in Gutenberg component
- Adding an html wrapper to a custom Block Pattern
- How to add a class to the element in a custom Gutenberg block
- Gutenberg: How to check if a block is used in a paginated post?
- Editor API Endpoint or Data Store That Provides a List of Meta Fields for Post Types
- Specify exact parent child relationship between two blocks
- Using custom Entities to retrieve external data in the Block Editor
- How can I remove a button from the paragraph block toolbar?
- Align Group blocks left or right
- Unable to override MediaPlaceholder component
- Run the edit function of parent block when something changes in InnerBlocks
- do_blocks does not include its CSS
- Track Block Pattern Insertion Within the Block Editor
- block variations registration in PHP
- How to add screen reader text to links inserted in the block editor?
- Auto synchronize saving of custom block editor entities
- Store data from nested block of gutenberg
- Output content of post excerpt into Innerblocks within Gutenberg block
- How to add a link in a translation in gutenberg
- component does not render in block save
- Adding block programmatically to InnerBlocks
- Filter root element of tag cloud block
- How to use Gutenberg blocks in widgets?
- Don’t expand “Most Used” accordion item when adding new block
- How do i get the link to a block?
- How to prevent Block Editor from adding id to block markup in save function?
- Dequeue Gutenburg Block Library CSS (‘wp-block-library’) in Admin
- Custom block Block Validation failure w/ deprecation declared
- Working with external library in gutenberg block
- Download Image from URL and Create a new Folder in wp-contents and save them there
- Using full site editing, can I edit just one specific post / page to be unique?
- Detect selected block pattern from a specific Pattern category
- How to add a message when post category is empty (the category have no published posts)?
- Add javascript file to a block pattern
- Block editor not recognizing markdown
- Can’t add front end script file using block.json for a custom block
- How to create Gutenberg patterns and patterns categories based on CPT posts and CPT terms?
- Gutenberg Block: Query for posts with blocks and sort by attributes
- How to Disable “Block Recovery” for HTML Blocks in Gutenberg
- Block error: post_taxs_obj is not a valid property of Object
- How to get the Gutenberg image block to show new Media Library listing
- useSelect in event callback – not retrieving value on time
- How to Batch Convert Gutenberg post to Classic post?
- How to create pre-designed page layouts for Gutenberg?
- Can anyone explain why setting a block attributes source to a data-attribute doesn’t work?
- How to: Provide component with innerBlocks to WordPress Gutenberg’s save function?
- How can I display instagram block with parse_block?
- Do not wrap custom block in an additional DIV but instead use only the JSX I provide
- Line break in Gutenberg post title?
- Can’t extend my custom gutenberg block
- Is there an easy way to remove the data-preserver-spaces span from blocks?
- How to Stop Gutenberg From Adding Classic Block
- How to increase width of code block in WordPress blog?
- Video, embed, html block usage out of the_content
- applyformat in gutenberg doesnt work and no errors
- Why does Gutenberg adds 4 around blocks? And how to change this?
- admin_notices not shown
- Have parent block’s isSelected be true if an innerblock is selected?
- How can I add the option to format to list in RichTextToolbarButton?
- Layout Settings in the new Gutenberg editor
- How to get blocks with same heigh in columns?
- Gutenberg: Issue trying to commit locally
- Block Theme Template parts – Why saving a part updates the other ones?
- No inline css, simple css file?
- How can I reset/remove background colour from a block
- Possible to use a block filter (blocks.getSaveContent.extraProps) with dynamic blocks?
- Elements positioning in a custom block
- Is it possible to get rid of the wrapping divs on a block component?
- In Full-Site-Editing, edits made to the code in a template part are not showing
- How to get appender icon to appear more often for innerblock usage
- Create a block variation of list elements
- Remove ‘default’ font option from Gutenberg typography settings
- Globally update pattern styles
- Block-based navigation and multi-language plugins
- Custom Gallery Block – Uncaught TypeError: setAttributes is not a function
- how to display gutenberg editor in a view
- Gutenberg list items nesting and creating invalid content errors
- Trying to understand block alignment
- Custom Link Block with own background color