-
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 - refactor post content overrides into post-content.php
- Loading branch information
1 parent
3a65a25
commit 7b03b40
Showing
2 changed files
with
33 additions
and
34 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Overrides core/post-content to return early in certain circumstances. | ||
* | ||
* Hack until a solution is delivered in Gutenberg. | ||
* | ||
* @param $attributes | ||
* @param $content | ||
* @param $block | ||
* @return string | ||
*/ | ||
function fizzie_render_block_core_post_content( $attributes, $content, $block ) { | ||
if ( ! isset( $block->context['postId'] ) ) { | ||
return ''; | ||
} | ||
/* | ||
if ( 'revision' === $block->context['postType'] ) { | ||
return ''; | ||
} | ||
*/ | ||
|
||
if ( fizzie_process_this_content( get_the_ID() ) ) { | ||
$html = gutenberg_render_block_core_post_content( $attributes, $content, $block ); | ||
fizzie_clear_processed_content( get_the_ID() ); | ||
} else { | ||
$html = fizzie_report_recursion_error( get_the_ID() ); | ||
//$html .= $content; | ||
} | ||
|
||
return $html; | ||
} |