Skip to content

Commit

Permalink
Merge pull request #335 from peiche/patch-3
Browse files Browse the repository at this point in the history
Refactored to use `has_blocks`
  • Loading branch information
hyunsupul authored Sep 9, 2018
2 parents e408eff + 864ee16 commit 5d0a781
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/includes/theme-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ function aesop_component_exists( $component = '' ) {
return true;

} else {
if ( function_exists( 'gutenberg_content_has_blocks' ) ) {
if ( function_exists( 'has_blocks' ) ) {
if ($component == 'timeline_stop') {
$component = 'timeline';
}
// if Gutenberg is on, check for Aesop Gutenberg blocks
if ( gutenberg_content_has_blocks( $post->post_content ) ) {
if ( has_blocks( $post->post_content ) ) {
// check if the given Aesop block exists
$blocks = gutenberg_parse_blocks($post->post_content );
foreach ($blocks as &$block) {
Expand Down

0 comments on commit 5d0a781

Please sign in to comment.