I found it (Argh!).
I was nearly there, but I made a stupid mistake. Inside the update
-function, the argument t
is not an object, but the value itself:
const update = ( t ) => {
// t is the selected term's ID as a string. Transform it to an integer
const x = parseInt( t, 10 );
// Update the assigned term or remove it, when zero
editEntityRecord( 'postType', 'my_custom_post_type', post.id, {
my_custom_taxonomy: x ? [ x ] : []
} );
// ...
}
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
- 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)
- 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
- 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: ‘
- Insert SVG code (not img) in HTML block
- How to enable Block Editor on the Posts page
- React to a change of the block alignment
- Object type for block Attribute (Gutenberg)
- Controlling the RichText component outside of blocks
- Custom Gutenberg Block: How to return plain HTML with save(), without escaping?
- Removing advanced section from brand new gutenberg block
- How to allow to add gradients to core/heading block?
- Gutenberg: how to hide server side render output in the editor but keep it in frontend?
- 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
- 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
- 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
- Gutenberg editor auto remove wrapping tags like
- Setting fontSize within core/heading
- 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?
- 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””`
- 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