How do i get the link to a block?
It’s just an anchor link, so it will be the URL of the post plus the ID you gave it, preceded by a hash.
It’s just an anchor link, so it will be the URL of the post plus the ID you gave it, preceded by a hash.
Elliot Condon of ACF notes that ACF block ID behavior could be better documented, but here’s what I know through my own testing and reading of the documentation: ACF assigns a new block ID when you first save an ACF block within a post. If you update the block data, such as if you change … Read more
Future readers: I will update this answer based on further research if I find a better way to do it, but this represents the current best effort. If you are reading this, and curious if I found a better solution, look below, if I found it i updated this answer, if I didn’t.. then I … Read more
I assume it’s because I need onSelect added, but I’m not sure what to do. What do I need to add to make it so when the user clicks on the variation it’s entered in the editor? One way, is add a variation attribute to your block type, then change the attribute value in the … Read more
You’ll want to target the block specifically via javascript. Brief example: wp.domReady(function() { wp.blocks.unregisterBlockType( ‘coblocks/map’ ); }); Save that to a js file and enqueue it via your custom function: add_action(‘enqueue_block_editor_assets’, ‘your_custom_enqueue_fucntion’)
In this case it seems a block pattern might suffice. The Group block has a templateLock attribute which can be set to all to prevent any additional blocks from being inserted within and also keep the Heading and Paragraph blocks from being moved or deleted. Here’s an example with the template lock and a custom … Read more
This happens because the Component need the correct data type. Use “number” when getting the value. Use “String” as the attributes type. const onChangeValue = ( newValue ) => { setAttributes( { value: String(newValue)} ) } <RangeControl label=”Rating” value={ Number(attributes.value) } onChange={ onChangeValue } min={ 1 } max={ 10 } step={ 0.5 } />
It’s because you have multiline: true, as documented: By default, a line break will be inserted on Enter. If the editable field can contain multiple paragraphs, this property can be set to create new paragraphs on Enter.
No, you don’t, and for very good reasons that might not seem obvious at first. In essence your block needs to be available everywhere and to be able to handle that, even if it does this by not displaying anything. Just because you’re in the site editor doesn’t mean the block won’t appear inside a … Read more
In this case I think it would be easiest to simply ignore any Gutenberg-specific implementation and set up the button’s click event to click() the first linked image in the gallery listing. The following searches the page for “gallery buttons” and the first linked image in a gallery block, then sets up the buttons to … Read more