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
- Remove slug from custom post type post URLs
- Allow member to have access to custom post type only. Permission to only edit their own posts
- How to get post content by calling ajax?
- Why are comments and trackbacks still getting through for custom post types?
- Get category id from post id of a custom post type
- Defining capabilities for custom post type
- Assign a Custom Role to a Custom Post?
- Limit widget to a specific registered sidebar
- WP_List_Table Inside Metabox Not Working on Submit
- Why get_next_post_link() or get_previous_post_link() doesn’t return the required links?
- Add metabox with media uploader in a custom post type [duplicate]
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- Showing current taxonomy terms
- Exclude post_type from admin comments_list
- automatically create taxonomy with same name as post title
- custom sortable column
- Custom user role not working as expected
- Wp-query causing problems with the_content();
- saving custom post type data to different table in wordpress
- Display “Post 2 of 4” on single post page?
- Query post types with multiple keys
- wp_query and comment_parent – select only posts with top level comments
- changing default comment form arguments [duplicate]
- How to embed form data within the ‘Add new post’
- Remove Post Page “View Post” Link
- Get all posts WHERE custom_field is LIKE value
- How to publish custom post type for custom role user and not “submit for review”?
- “Allow Comments” box cannot be checked
- Allow Administrator role access to custom capabilities [duplicate]
- How to enable a custom post type to custom user role in WordPress
- How to make post sticky in the admin page?
- Loop on front-page.php
- How to create custom boxes with text inside?
- Display content based on a users login
- Which post does a taxonomy term belongs to?
- Changing custom type name hides the posts
- Add custom field to Posts and sort by it
- How to set individual capability of post type in individual category
- 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
- WooCommerce Customer Role Delete Custom Post Type
- How to change the post type a theme shows by default?
- No Permission to add new Page, Post or CPT with Admin role
- Update postmeta Parent when post_status child change
- Deny user access to edit post while allow him to edit custom post type
- Convert comments to Custom Post Type
- Reworking function for counting custom post type posts count
- Custom setup of wordpress comments that are displayed
- help
- WordPress custom post type capabilities issue
- How to Display Posts From Category Within a Custom Taxonomy?
- How to Make infinite loop of post
- WP_Query with custom post type ID
- Building Forums with Custom Post Types
- Published post auto change status to pending after 90 days
- How to retrieve all wordpress posts (specific type) inside a function in php?
- Enable comments on custom page type – option not showing in “customize” for theme
- Automatically update slug with latest title within custom post type [duplicate]
- Modifying the default post from wordpress
- How to Query in WordPress which shows Alphabetic Posts?
- Does “Custom Post Type” can have page hierarhy option?
- How set template for “custom post type” individual post
- A sports wordpress website
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Settings -> Reading -> Posts Page ->Blog — is not working in my website
- Is it possible to get the specific content on the search page?
- How to mass get post editor URLs
- How to create additional rendering for custom post types?
- SELECT custom post type and its meta in SQL
- Restrict admin pages for specific user role
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- How do I insert a custom post type query after a certain number of recent posts and then resume recent posts?
- I want to show post details based on roles user login
- How to create editable sections in wordpress?
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Assign for all post of a post type a specific single-post template
- Widget area for individual posts (custom post type)?
- update a posts of other custom post type
- Show custom post type under last posts configuration
- Prevent author role from editing others posts
- Custom Post Type used for FAQs Accordion
- How to Associate Posts with Pages
- delete custom post type using a submit form
- Why are my wp urls showing page not found?
- Post content stays the same but permalink changes ?
- Comment moderation with disqus comments
- Can I set a CPT title field to a dropdown with preset options if user is of a given type?
- Styling first post using Advanced Custom Fields
- How do I display the index position of a post from a custom post type?
- Sort ACF by custom taxonomy