fix: render js inline instead of footer
avoids broken JS if shortcode is pre-rendered / not visible on page
This commit is contained in:
parent
0fe16d92af
commit
0e738f22bb
@ -702,13 +702,6 @@ function display_feed($atts) {
|
||||
);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$script = ob_get_clean();
|
||||
add_action('wp_footer', function() use ($script) {
|
||||
echo $script;
|
||||
});
|
||||
ob_start();
|
||||
?>
|
||||
<div class="include-mastodon-feed<?php echo (true == $atts['darkmode'] ? ' dark' : ''); ?>" id="<?php echo esc_attr( $elemId ); ?>"><?php echo esc_html( $atts['text-loading'] ); ?></div>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
|
Loading…
x
Reference in New Issue
Block a user