PHP Block Classes don't update in Wordpress

Hey There,

I’m facing such a weird Issue which I can’t seem to resolve and I thought, maybe here is someone who is more experienced than me and can help me out. It seems to be more like a Gutenberg problem than a Pinegrow problem, but I’ll try my luck here, maybe anyone else has faced something similar.

The Problem:
I’ve created a PHP-Block with a class of .col-8 assigned, now I have changed that class inside of Pinegrow to .col-auto and exported the files. So far so good, the new block files also get exported, I see the changes inside of the exported php file. There the CSS class has definitely changed to .col-auto.

My understanding of the Gutenberg-PHP-Blocks is that whenever they rerender inside of Gutenberg they automatically get updated to the latest version of that php “template”. At least whenever I insert that block new I thought it should use the latest version of it.

For some reason the block behaves like it would be cached always bring in the version with .col-8 class, doesn’t really matter what I try it always stays at that version.

Does anyone know why it behaves like that? What could I do to force an update on that block?

TIA for your Help!

@Wolfgang.Hartl does this happen in the block editor or on the front-end site as well?

As far as I know, PHP blocks are rendered each time they are displayed.

On both ends, frontend and editor. I’ve ended up now renaming the block which works pretty fine. Without further investigation my biggest guess is some incompatibility with another plugin on that site (it’s still the one I mentioned earlier with the very ooold setup :smiley: ). Whenever I deactivate all plugins it works, but I don’t want to find myself recreating functionalities from old plugins so I’ve decided to go with renaming the block.

The weird thing is that there is no caching plugin active, and the exported file also show the right class, really really strange, since I can’t imagine what would cause that behavior.

One thing I know for sure, I’ll never ever touch such old sites again without completely redoing them first! :wink:

1 Like