[wp-trac] [WordPress Trac] #56939: Twenty Twenty-Three never calls comments_template
WordPress Trac
noreply at wordpress.org
Thu Nov 3 02:11:58 UTC 2022
#56939: Twenty Twenty-Three never calls comments_template
---------------------------+-------------------------
Reporter: Justin_K | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Bundled Theme | Version: 6.1
Severity: normal | Resolution: worksforme
Keywords: close | Focuses:
---------------------------+-------------------------
Comment (by Justin_K):
There we go, that's the solution. So the functionally identical
replacement for:
{{{#!php
add_filter('comments_template', 'suppress_comments');
function suppress_comments($file)
{
global $post, $opt_vgb_page;
if ($post->ID == get_option($opt_vgb_page)) return dirname(__FILE__) .
'/_blank.php';
else return $file;
}
}}}
seems to be:
{{{#!php
add_filter('pre_render_block', function($pre_render, $parsed_block){
global $post, $opt_vgb_page;
if($post->ID == get_option($opt_vgb_page) &&
$parsed_block['blockName'] == "core/comments"){
return "";
}
}, 10, 2);
}}}
Will also post a comment on the comments_template hook page. Thanks!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56939#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list