Issue with Advanced Columns block and Custom Post Type with block template
-
Hi there,
I’m one of the developers of the LifterLMS plugin.
One of our customers reported an issue with the Advanced Columns block and our Course custom post type (you can see it here).
Basically when changing the Advanced Columns block number of columns the Course content, in the block editor, reverted to the default, as specified in the'template'
cpt property.
I’ve investigated into this and found the same happens, presumably, with whatever custom post type having thetemplate
property set.
As proof of concept you can try this snippet (that you can also find here):add_action( 'init', function() { register_post_type( 'movies', array( 'labels' => array( 'name' => 'Movies', 'singular_name' => 'Movie', ), 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => 'movies' ), 'show_in_rest' => true, 'template' => array( array( 'core/heading', array( 'content' => 'Whatever', 'level' => 3, 'textAlign' => 'center', ), ), ), ) ); } );
Then:
– create a new Movie
– delete the default h3, to better appreciate the issue
– publish
– add an Advanced Columns block
– select the number of columns
you’ll see the content reverted to the default template.Could you please look into this?
Thanks
- The topic ‘Issue with Advanced Columns block and Custom Post Type with block template’ is closed to new replies.