Category: WordPress

Block plugin updates and the sometimes delayed effect on the frontend

I am a big fan of Gutenberg. But a few weeks back I had multiple content pages that got destroyed in the frontend after updating, without changing much.

The reason: a block plugin had an update earlier which changes block markup, and with that, a few of my custom CSS rules did not apply any longer. Well, that could also happen with plugins that use shortcodes, but…

Continue reading Block plugin updates and the sometimes delayed effect on the frontend

Get correct metadata after post update in block editor

Sometimes it is necessary to do something after a post was saved. When using the old hooks like save_post and post_updated, the result is not as expected with the block editor: the metadata values are the old ones from before saving.

The rest_after_insert_{$this->post_type} action hook comes to the rescue ({$this->post_type} needs to be replaced with the post type, for example, post or page). It gets the post object as the first param and when fetching data via get_post_meta(), we get the correct data.

WordPress weekly recap #30: Registering metadata in 4.9.8 and more

WordPress 4.9.8 introduces a way to register metadata for specific object subtypes, instead of only for whole object types like all post types.

As I needed to skip the last two recaps, I will include posts from that two weeks, which I think are important enough, with the posts from the current week 30 into this post.

Continue reading WordPress weekly recap #30: Registering metadata in 4.9.8 and more