Gutenberg Editor: dynamically edit slug field based on ACF field
I'm trying to edit the slug field on the right panel of Gutenberg editor and edit its content based on a custom field.
I noticed that I can access to the field by using wp.data.select('core/editor').getEditedPostSlug();
in JavaScript to interact with the React Component. My question is: how can I edit this field in JavaScript? There's no .setEditedPostSlug()
method for this and select the field in normal JS script is impossible because the field's ID is generated each time the panel is opened and if we close the panel, the field disapear from the DOM.
Topic block-editor slug permalinks Wordpress javascript
Category Web