Cannot Disable Comments for my Custom Post Type
-
Hello, I have registered a post type ‘member’ which supports ‘title’ and ‘revisions’ and nothing else. No comments.
'supports' => array( 'title', 'revisions' ),
When editing a ‘member’ post the Discussion and Comments meta boxes are not only present but “Allow comments” is checked (enabled)! How could this be when the post type does not support comments? I have also tried manually disabling comments via my theme’s functions.php file.
// Remove post type support add_action( 'init', 'my_custom_init' ); function my_custom_init() { remove_post_type_support( 'page', 'thumbnail' ); remove_post_type_support( 'page', 'comments' ); remove_post_type_support( 'tribe_events', 'comments' ); remove_post_type_support( 'tribe_events', 'author' ); remove_post_type_support( 'member', 'comments' ); add_theme_support( 'post-thumbnails', array( 'tribe_events' ) ); }
All the other remove_post_type_support lines work as expected.
What could be enabling comments for this post type? I switched from my custom theme to the TwentyNineteen theme. I’m running WP 5.1 with all plugins up to date. Important to note this issue was occuring yesterday with WP 5.0.x prior to updating to 5.1.
Thanks in advance for any help or info!
- The topic ‘Cannot Disable Comments for my Custom Post Type’ is closed to new replies.