Create a trailing block with programatically generated Gutenberg columns

I’ve currently “solved” this by backfilling with empty divs: $array_chunks = array_chunk($array_of_posts, 3); foreach($array_chunks as $posts) { echo ‘<div class=”wp-block-columns”>’; foreach($posts as $post) { echo ‘<div class=”wp-block-column”>’; // entry echo ‘</div>’; for ($i = 0; $i < ( 3 – count($posts)); $i++) { echo ‘<div class=”wp-block-column”>’; echo ‘</div>’; } } echo ‘</div>’; } But that … Read more

Get the ID of a page in Parent combobox in editor

After some time reading the Editor Documentation I found the proper solution. This is how you can listen to changes and get the id of the Parent Combobox select in the WP Editor: wp.data.subscribe( function () { var newParent = wp.data.select(‘core/editor’).getEditedPostAttribute(‘parent’); console.log(newParent); } ); wp.data.subscribe is called every single time a change occurs in the … Read more