Skip to content

Commit

Permalink
Issue #25 - remove workaround for post-excerpt
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Dec 11, 2020
1 parent 029f4a9 commit cf976d1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions includes/post-excerpt.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?php
/**
* Appends the missing </div> to the core/post-excerpt block.
* Overrides the behaviour of the core/post-excerpt block.
*
* This used to append a missing `</div` to the end of the excerpt.
* In actual fact the logic was wrong.
* This isn't needed anymore as Gutenberg's been fixed.
*
* Keeping this function in case I want to do other things with core/post-excerpt.
* eg Recursion checking.
*
* @param $attributes
* @param $content
* @param $block
* @return string
*/
function fizzie_render_block_core_post_excerpt( $attributes, $content, $block ) {
bw_trace2();

$html = gutenberg_render_block_core_post_excerpt( $attributes, $content, $block );
// Should really check that it's missing.
if ( 0 !== strrpos( $html, '</div>') ) {
$html .= '</div>';
}
return $html;
}

0 comments on commit cf976d1

Please sign in to comment.