hey guys!
I’ve got a question: I want to use your plugin for my users so that they can see the h5p contents in the gutenberg editor instead of switching to the frontend view. but unfortunately it’s not working. maybe you can help me with that? ??
thanks!
greetings
]]>Hi, I have a suggestion for render callback function that will output shortcode for non admin pages the same way it’s done in main wordpress shortcode block (I had trouble with some complicated shortcodes otherwise).
function swp_rnk_shortcode_preview_callback($atts)
{
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
ob_start();
?>
<div class="swp-rnk-preview">
<?php
echo ! empty( $atts['shortcodeText'] ) ? do_shortcode( $atts['shortcodeText'] ) : '';
?>
</div>
<?php
$html = ob_get_clean();
return $html;
} else return wpautop($atts['shortcodeText'] );
}
]]>