I developed a free block called "SimpleTOC". It uses server side renditions in php. I added the feature that it refreshed itself everytime the user saves the post. I do this by updating an attribut with a random number to retrieve the newest php output.

The result is that after the user saved the post, the editor tells the user:

Changes you made may not be saved.

That is expected because it has changed because of this:

  const { isSavingPost } = select( 'core/editor' );
  const [isSavingProcess, setSavingProcess] = useState(false);
  const advpanelicon = 'settings'; 
  const updatePost = function () {
    if( attributes.autorefresh === true ) {
      setAttributes({ updated: Date.now() });

  subscribe(() => {
      if (isSavingPost()) {
      } else {

  useEffect(() => {
      if (isSavingProcess) {
  }, [isSavingProcess]);

Is there an easy way to exclude the block from the changed content warning? I know that this means: You can't have your cake and eat it. Or any other idea?

Here is the code: https://github.com/mtoensing/simpletoc/blob/master/src/edit.js

  • Any idea how to do this?
    – Marc
    Sep 14 at 12:01


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.