[wp-trac] [WordPress Trac] #56939: Twenty Twenty-Three never calls comments_template
WordPress Trac
noreply at wordpress.org
Wed Nov 2 23:10:54 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:
---------------------------+-------------------------
Changes (by TimothyBlynJacobs):
* status: new => closed
* resolution: => worksforme
* milestone: Awaiting Review =>
Comment:
If you are looking to hide comments for a specific page, I'd recommend
closing comments for that post via the Block Editor.
If you need to do it programatically, you can use the `comments_open`
filter instead.
{{{#!php
<?php
add_filter( 'comments_open', function ( $open, $post_id ) {
if ( $post_id === 5 ) {
$open = false;
}
return $open;
}, 10, 2 );
}}}
`5` in this case is a placeholder for whichever post ID you'd like to
disable comments for.
This trac is used for managing bugs and enhancements affecting WordPress
Core. For further help with developing your site, I'd recommend visiting
the [https://wordpress.org/support/forum/wp-advanced/ Support Forums].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56939#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list