Remove comment support from register_post_type args so the setting works.
-
I don’t use comments on the single event pages and noticed that a comment validation scripts was loaded when the show comments option in the TEC settings was off. In examining this I discovered that the showcomments option in the setting only blocks comments from being inserted in the page, but the support for comments is still declared and the default value then opens comments on an event page even though TEC wont show them because of it’s own settings.
This means that in the editor the discussion meta is still displayed when TEC is set to not show comments in events.
In the code I see that when the showcomment option is set to yes, that the support for comments is added. The problem is that it adds support that is always already there, so this only makes sense when the initial support doesn’t include comments. This is also illustrated by the fact that the support isn’t removed when the setting is not yes.
It seems to me that this is a bug and the support should not initially be declared via de register_post_type, so it can be added depending on the setting.
Please change the
Tribe__Events__Main->post_type_args
declaration/assignment in Main.php.Regards,
Hans
- The topic ‘Remove comment support from register_post_type args so the setting works.’ is closed to new replies.