Changing tags from a Gutenberg sidebar saves old ones on update
-
When I change post tags from my Gutenberg sidebar with
const tags = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'tags' ); const newTags = [...tags]; newTags.push(1337); wp.data.dispatch('core/editor').editPost({ 'tags': newTags });
the UI will be updated (current tags correctly listed in standard post sidebar).
But when I click the update button, the old tags are there again.
When I execute
wp.data.select( 'core/editor' ).getCurrentPost();
via the developer tools console right before hitting the update button, the tags are correct. After clicking the update button, the tags are old again.Is this a bug or do I miss something?
Note: this is more or less the same as https://www.ads-software.com/support/topic/adding-tags-programmatically-in-gutenberg/ but it is not working for me with version 5.9.3.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Changing tags from a Gutenberg sidebar saves old ones on update’ is closed to new replies.