Replies: 1 comment 1 reply
-
Thank you, @GregoireSailland, for opening a separate discussion. Can you share more details about the use case and what you plan to achieve? Maybe there's a different way to do it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found the way to Lock blocks programmatically:
But when blocks are saved, they keep the lock state
I can't find a filter or any way to restore the block lock sate on save
I would like to restore the state with props.attributes.old_lock
Thanks in advance
I already tried 'blocks.getSaveContent.extraProps' and 'blocks.getSaveElement' filters without success
Is there a filter on blocks content/attributes during save?
(Something like https://developer.wordpress.org/reference/hooks/wp_insert_post_data/ in php but for gutenberg in js)
Maybe my approach to the problem is wrong
I also tried
and
add_action( 'init', 'myplugin_register_template' );
but this seems to only lock new created posts with the template defined
Beta Was this translation helpful? Give feedback.
All reactions