Skip to content

Instantly share code, notes, and snippets.

@mennwebs
Last active February 15, 2023 23:50
Show Gist options
  • Select an option

  • Save mennwebs/89f66246a80fde4e770becf77a71ed06 to your computer and use it in GitHub Desktop.

Select an option

Save mennwebs/89f66246a80fde4e770becf77a71ed06 to your computer and use it in GitHub Desktop.
GenerateBlocks - Output CSS with Content (for Frontend, to get WordPress content via API)
// GENERATEBLOCKS CSS
if (function_exists('generateblocks_get_frontend_block_css')) {
add_filter('the_content', 'p_css');
}
function p_css($content) {
global $post;
$css = wp_strip_all_tags(generateblocks_get_frontend_block_css());
return '<style id="gb-css">' . $css . '</style>' . $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment