Created
July 8, 2020 20:16
-
-
Save generatepress/8379abe390179c9fe828f2d6aa068eef to your computer and use it in GitHub Desktop.
No cache GB content fetch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateblocks_get_parsed_content( $content = '' ) { | |
if ( ! function_exists( 'has_blocks' ) ) { | |
return; | |
} | |
if ( ! $content && has_blocks( get_the_ID() ) ) { | |
global $post; | |
if ( ! is_object( $post ) ) { | |
return; | |
} | |
$content = $post->post_content; | |
} | |
$content = apply_filters( 'generateblocks_do_content', $content ); | |
if ( ! function_exists( 'parse_blocks' ) ) { | |
return; | |
} | |
$content = parse_blocks( $content ); | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment