Duplicate Snippet
Embed Snippet on Your Site
MemberPress: Disable Comments for Courses, Lessons, Quizzes, and Assignments
The code snippet will disable comments on all MemberPress Courses custom post types: courses, lessons, quizzes, and assignments.
To exclude any of the MemberPress Courses post types from the code snippet, remove the related post type in the array on these lines:
if (in_array($post->post_type, ['mpcs-lesson', 'mpcs-course', 'mpcs-quiz', 'mpcs-assignment'])) {
MemberPress Courses post types:
Courses: mpcs-course
Lessons: mpcs-lesson
Quizzes: mpcs-quiz
Assignments: mpcs-assignment
Code Preview
php
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments