I have a custom post type “News” that contains three custom fields (video_id, video_start, video_end). These are used to display video snippets. This can be done with a hook and the attached code.
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0" type="text/html" allowfullscreen="allowfullscreen" src="https://www.youtube.com/embed/<?php echo get_post_meta( get_the_ID(), 'video_id', true ); ?>?autoplay=1&fs=0&controls=0&iv_load_policy=3&showinfo=0&rel=0&cc_load_policy=0&start=<?php echo get_post_meta( get_the_ID(), 'video_start', true ); ?>&end=<?php echo get_post_meta( get_the_ID(), 'video_ende', true ); ?>"></iframe></div></figure>
How can I achieve the same with a custom shortcode [video_block_cpt_news] ? I need this shortcode to use with GenerateBlocks.
Thank you for your suggestions.