I tracked the issue back to a bunch of blocks, which all use the post selector. Since the last plugin update (June 30th) I cannot use them any more like I could before. I see an error in the editor as well, when I try to add them. When I update the plugin to the latest version (July 6th), I get a plugin has no header issue and also a plugin error I posted in my reply here and wordpress changes to recovery mode.
I followed you suggested options and switched the blocks to php code in functions.php instead of the admin interface ony my staging environment, but this only solved the plugin error in the plugin list. I cannot add the blocks anymore, like I could in the versions before.
Regarding the blocks, I have a post selector, where users can choose the posts they want to display in this block. In the combined code for FE & BE I go through that selected post objects via foreach like your documentation shows, I check for post_thumbnail and build a post grid with the selected posts and print them out via echo post by post.
<?php
foreach( $attributes['post-obj-select'] as $post_selects ):
/** Check Post_Thumbnail **/
if (has_post_thumbnail( $post_selects->ID ) ) {
$img = get_the_post_thumbnail_url( $post_selects->ID, "post-teaser" );
} else {
$img = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
}
echo '<a href="'.get_the_permalink($post_selects->ID).'"><img class="img-responsive wp-image-'.$post_selects->ID.'" src="'.$img.'" /><h4>'.esc_html($post_selects->post_title).'</h4></a>';
endforeach;
?>
When I use the code without the block environment as vanilla php, I don’t get any errors or warnings. Why is this causing troubles? The Log file only tells me about the eval()’d issue. All I changed is the version of the plugin.
Thank you for any advice, how I can solve this issue.
BR M