How do I get the site url from a Block (within the block editor)
I have a block in which I’d like to display a link based on the site url. So for example, when the user enters “Futuristic”, the link will display as https://my-site.com/futuristic/
I have a block in which I’d like to display a link based on the site url. So for example, when the user enters “Futuristic”, the link will display as https://my-site.com/futuristic/
[EDIT] Problem 3 is solved (just I must to remove source: 'text' from attributes declaration to allow store data in the the block’s comment delimiter).
I’m using a code snippet in functions.php to modify all youtube embeds, in order to add extra player parameters. Prior to WordPress 5.6, the youtube blocks could be filtered with
if( "core-embed/youtube" === $block['blockName']) { // do something }
I’ve built a Featured Gallery component for Gutenberg that uses the withSelect and withDispatch higher order components to store the selected images in a meta field.
I’m wondering if this code can be converted to use the useSelect and useDispatch hooks instead to simplify it. Is it possible? I tried to do it myself reading the almost useless Gutenberg docs with no success.
Any help would be appreciated.
I am using $wpdb to do a mysql query and get the data from a php file.
Is there a away to set the gutenberg block-editor color palette other than in the theme?
I thought I had it. I added an attribute “max_level” and a SelectControl element “SelectMaxLevel”. Everything works according to plan: I can set the max level and it is saved in the block. When I save the post and display the post see that the php part uses the “maximum level” variable. But when I edit the post the blocks loads it’s default value. Why does this happen?
I have an options page I have created for a post type which doesn’t use a Guttenberg block, but I was wondering if inside that page I could somehow make use @wordpress/data in order to retrieve posts with the below instead of using the REST API?
I managed to get an attribute working in my plugin. Well, sort of. I can read and write the attribute props.attributes.content . But I get the message in the Gutenberg block itself:
I build a small TOC plugin with a ServerSideRender component. It’s an open-source hobby project to understand Gutenberg better: https://wordpress.org/plugins/simpletoc/ Now I would like to add attributes to the block to toggle options like “disable title”. A few months ago with your help here I managed to make the plugin work, but it sends “fake attributes”. In my case, this is only a date.