Filter the 'comments_open' check. It happens inside of the function with the same name, and that function is called in a theme usually like this:
comments_open() and comment_form(
array (
'comment_notes_after' => ''
)
);
This is how the filter works:
add_filter( 'comments_open', 'wpse_98775_comment_check', 10, 2 );
function wpse_98775_comment_check( $open, $post_id )
{
if ( $open )
return $open;
if ( 'my_post_type' === get_post_type( $post_id ) )
return TRUE;
return $open;
}
You could create a custom plugin with this snippet.
Related Posts:
- modify all posts of a category to “no comments allowed”
- Hiding posts by other users and non-logged in
- WordPress comments_open for specific user role or post type
- How to assign classes to all elements?
- Instructor can view, edit, delete only theirs courses
- How to create a discussion post when a custom post is created?
- Editor role isn’t seeing specific post type posts with only post_type parameter
- Error 403 when posting comments to a custom post type from a different page
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Restrict user to only one custom post type
- Open Custom Post Type as PDF
- Using The REST API How To Pull All Custom Posts?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- only a certain role has access to a cpt
- How to restrict CPT post’s fronted view only for specific user roles?
- Show the same Article Available in Other Categories
- Getting posts under the custom post type ui category
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- current_user_can() return FALSE but debugging says TRUE
- Role capability delete multiple post type posts doesn’t work
- Display only one post each WEEK
- List children on child post
- How to allow a custom user role to create, edit, delete a specific custom post type only?
- get_comments not working on custom post types
- Display content based on a users login
- Restrict custom post type from appearing with ?post_types=
- Show custom post type filtered by category
- create parent post using wp_insert_post
- Turn on and off custom post type from admin?
- Missing Posts in Custom Taxonomy List
- Custom Post Type Set Comments ON by default without show METABOX
- map_meta_cap woes
- Display random posts, but omit the post it is on?
- Roles for Custom Post Types
- How do I do this with WordPress? Taxonomies?
- Disable block with taxonomies at post page
- Role scoping for contributors down to the field level
- I would like to have different styles for my posts based on the content of each post
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Showing posts from different categories and from custom post type
- Get latest 3 posts from multiple CPT in one query
- can’t see custom post content filtered under “mine” filter in admin panel
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Which post does a taxonomy term belongs to?
- List custom taxonomy specific to one custom post type
- Define new user capability for custom post types?
- Post image in WordPress not appearing on home page
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Meta query for custom post type ignored in main query
- Changing custom type name hides the posts
- Display Ad on Specific Categories
- Custom post types as sub menu pages and role capabilities issue
- WordPress multiple custom post types capability conflict in a single menu
- Update Post Meta for a logged in user
- Add custom field to Posts and sort by it
- Add custom post type settings to wordress default posts
- Only view/edit/delete CPT made by users with the same role
- How to set individual capability of post type in individual category
- Restrict Access to Posts based on Custom User and Post Meta Data
- Giving permission to anyone (non-users as well) with a password to edit a post, possible?
- Get related posts of child term of custom post type
- Two Custom Post Types Many to Many Relationship
- Problem with displaying posts in the CPT category
- I want to create custom post in which user can share files like PDF & DOCx
- JS innerhtml changing style when using AJAX
- Show titles, date of all posts on single category page
- WooCommerce Customer Role Delete Custom Post Type
- Side effects of Script and Iframe in post
- How to change the post type a theme shows by default?
- Set a checkmark in a category based on a URL-parameter
- Several post types on WP Query by tag and taxonomy
- No Permission to add new Page, Post or CPT with Admin role
- Update postmeta Parent when post_status child change
- Allow Contributor to edit but not update a published post
- custom post type category count shortcode
- Add custom field in comments form
- Portfolio Page for Classic Posts
- Add post location with mile radius allowing search
- Get the category from custom post type
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Set up post page like JAMA articles
- Users create/join groups
- Create another comment system for CPT
- Custom Post Slug same as Parents Category Slug
- Shortcode not working with post counter
- Disable user from updating certain posts
- Edit the author of custom post type
- Changing default ‘posts’ parameters with register_post_type_args
- Admin Column does not populate with data
- “Submit for review” for updates on existing posts
- Access to CPT but not to ‘post’ post type
- Allow add new post access to custom post but not wp post for some role
- Deny user access to edit post while allow him to edit custom post type
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- Prioritize posts in query by meta keys?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Create custom post with custom user rules
- Allow user to only access custom post type