Forum Replies Created

Viewing 1 replies (of 1 total)
  • I had a similar situation recently where I wanted to be able to stick a reusable block outside of the editor (after blog post content on all posts in this case). I did some digging and got it working with the code below. I ran it on the wp hook, and $post is the post object for my block (but passing any post should work.

    $uagb_helper = UAGB_Helper::get_instance();
    $uagb_helper->get_generated_stylesheet( $post );

    get_generated_stylesheet() checks for UAGB blocks in the post and adds any needed styles/scripts to the list of assets the plugin will enqueue.

    Obviously this is not official, but I hope it helps!

    • This reply was modified 3 years, 6 months ago by scottjd. Reason: clarity
Viewing 1 replies (of 1 total)