-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #25 - remove workaround for post-excerpt
- Loading branch information
1 parent
029f4a9
commit cf976d1
Showing
1 changed file
with
8 additions
and
7 deletions.
There are no files selected for viewing
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
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; | ||
} |