OK, I found a way to do this after browsing the source code. I do note that the code that helped me lives under deprecated.js
so it’s possible this won’t continue to work.
Here’s the JS code I have in my plugin directory
function addAlignmentToGroups(settings, name) {
if (name !== "core/group") {
return settings;
}
return lodash.assign({}, settings, {
supports: lodash.assign( {}, settings.supports, {
align: ['wide', 'full', 'left', 'center', 'right']
})
});
}
wp.hooks.addFilter(
'blocks.registerBlockType',
'myapp/alignments/group-block',
addAlignmentToGroups
);
And the PHP code to load it:
<?php
function my_enqueue() {
wp_enqueue_script(
'my-align-blocks',
plugins_url('dist/align-blocks.js', __FILE__),
['wp-blocks']
);
}
add_action('enqueue_block_editor_assets', 'my_enqueue');
Related Posts:
- How to trigger JS in gutenberg page load
- Gutenberg: Block validation failed
- Change order/position of Gutenberg inspector control panel
- Gutenberg Inspector Controls
- What version of Gutenberg is included with WordPress?
- serialize_blocks breaking html tags in content
- How to use getBlockIndex
- Hide or show Gutenberg custom block using date range
- Use page Title in Gutenberg custom banner block
- How to add code to `head` with WordPress 5.9 FSE (Full Site Editing)
- Block Editor: add an aria-label to an option inside a SelectControl
- Gutenberg: Get All Attributes From «core/image» Block
- How to make the Preview button automatically open new tab?
- Gutenberg: How can I disable backspace key from deleting an empty paragraph block?
- Where on Github, or elsewhere, can I find the code for core-blocks?
- Gutenberg translation is not working
- How to add javascript function in the “save()” of gutenberg block?
- How to check if current admin page is Gutenberg editor? [duplicate]
- Possible add color palette for a block’s inner div instead of outer?
- Programmatically trigger the gutenberg save
- Gutenberg : in the backend, I just want to store a JSON object
- wordpress gutenberg url popover custom options
- Text Editors Are Hiding Text
- Disabling deleting reusable blocks except on the reusable block manager
- Gutenberg remove Most Used group
- Gutenberg. How To Register A Custom Block Style For Specific Post Type Only
- get used blocks in post and detect changing
- Does `viewScript` in `block.json` actually enqueue a js file?
- How to know whether you are editing a page or a post?
- Gutenberg get block name
- How has my WordPress editor become so basic? Cannot add blocks or see anything visual
- Block Validation Fails: ‘
- Create RangeControl in gutenberg Block
- Where are the layout defaults in Twenty Twenty Two coming from?
- How to Disable auto id attributes in Heading tag?
- Gutenberg: how to hide server side render output in the editor but keep it in frontend?
- How to makes Custom Post Type posts as Gutenberg’s patterns?
- Can’t run WP e2e-test-utils because the browser exits on login?
- How to Get a List of Formats of a Block?
- Remove a plugin from the Gutenberg sidebar
- Gutenberg how to save to post meta?
- How to get current post id in Gutenberg Block save function?
- Gutenberg: dynamic block ToggleControl error in saving
- How to limit the selection of the first level block in Gutenberg editor
- disable gutemberg welcome message
- props.setAttributes results in “Maximum update depth exceeded.”
- How can I programmatically select a Gutenberg block?
- Clipboard processing in Gutenburg
- Gutenberg: Dynamic rendering of RichText
- Block Controls not showing
- Gutenberg and FSE: How to exclude a block from full site editing
- Disable only one Gutenberg block programatically / coblock/maps not listed in blocks
- How to select block variation from BlockVariationPicker
- WordPress Full Site Editing: How can I access my posts listing page?
- Editable button with RichText for Gutenberg custom block
- How Do I Prevent An Image From Automatically Adjusting In Guttenberg Block Gallery?
- How to reload data stored for a sever side gutenberg block in the editor
- Using wp_set_script_translations without manually registering the script
- How to remove the old “Custom CSS” from customizer after the theme has been migrated to Gutenberg FSE
- Why am I getting the error: Cannot update a component (`Unknown`) while rendering a different component (`Edit`)?
- Update number of posts when attribute changed
- Connect WordPress and react front-end
- Block variation / Variation API scope “transform”
- Gutenberg editor auto remove wrapping tags like
- Setting fontSize within core/heading
- Unable to edit server side rendered block
- WordPress Dynamic Block with multiple checkboxes
- Embedded block editor in block editor
- useSelect in block Edit always returns default store value
- Count Gutenberg blocks on the front-end?
- How to call a react hook on edit of registerBlockType?
- Why does the paragraph block automatically add class?
- How can I block embeds and show an individual preview image per block?
- add arrow icon next to read more link on latest posts gutenberg block
- Create a trailing block with programatically generated Gutenberg columns
- How to make attributes unique to Gutenberg blocks
- How to check title is being entered in Title Case?
- Gutenberg link of internal page not showing
- How do I trigger the sidebar reveal for my sidebar plugin in the Gutenberg editor?
- Create Gutenburg Block to render inline SVG
- Gutenberg blocks not full width
- How to extend the URLPopover render settings for the paragraph Gutenberg block?
- Custom Image Gutenberg Block With Caption
- How to make a block similar to another block
- Gutenberg: How to enqueue scripts conditionally in render_callback by checking for an attribute?
- How can I reintroduce autocompletion of Gutenberg components in Visual Code?
- Blocks – any way to have editor honor width percentages on child blocks?
- Using `esc_attr( get_block_wrapper_attributes() )`, results in `class=””wp-block-foo””`
- Change Featured image location from side to normal using react (gutenberg)
- Get postId in a wordpress pattern file?
- Remove placeholder from core/image in InnerBlocks template
- Gutenberg block not displaying prop values
- ACF InnerBlocks breaks css grid, How can we add classes to allowedblocks (WordPress Gutenberg)
- In Full Site Editing, how do I get the templates I created to appear in the site editor when populating a new page?
- How to disable block directory?
- Adding custom link text to a URLInputButton
- Rearrange order of block into a block category gutenberg
- Gutenberg Block Deprecation – Handling old viewScript and styles
- Resaving posts to update static blocks
- How to dynamically add style tags to Gutenberg editor in react