Plugin not working with Full Site Editing (I have a fix)
-
Hi Marc,
First off, great plugin. However, I did run into an error in the Site Editor where I have the the block in a sidebar template part that is separate from the main content area. On the frontend, everything works, except for the
render_block
filter. The ids are not getting added to the headings.I believe the filter is being called too early, before all the necessary templates and template parts have been retrieved.
Anyway, if you filter
render_block
after plugins have loaded, everything seems to work as expected. My quick solution was the following:add_action( 'plugins_loaded', __NAMESPACE__ . '\\filter_render_block_callback' ); function filter_render_block_callback() { //add only if block is used in this post. add_filter( 'render_block', __NAMESPACE__ . '\\filter_block', 10, 2 ); };
You may want to test this a bit, but I can confirm it is working for me in the the TT1 Blocks theme.
Hope that helps.
– Nick
- The topic ‘Plugin not working with Full Site Editing (I have a fix)’ is closed to new replies.