[wp-trac] [WordPress Trac] #56939: Twenty Twenty-Three never calls comments_template

WordPress Trac noreply at wordpress.org
Wed Nov 2 01:01:27 UTC 2022


#56939: Twenty Twenty-Three never calls comments_template
---------------------------+------------------------------
 Reporter:  Justin_K       |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:  6.1
 Severity:  normal         |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------

Comment (by Justin_K):

 Use case is to hide/remove the comments output from a specific pageID -
 i.e. pretty much the precise codeblock from above:

 {{{#!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;
 }
 }}}

 (where _blank.php is empty)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56939#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list