Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Set the default comment status for events to 'closed'.
- *
- * Could easily be adapted to target all post types or a different
- * post type.
- */
- add_filter( 'get_default_comment_status', function( $status, $post_type ) {
- if ( 'tribe_events' !== $post_type ) {
- return $status;
- }
- return 'closed';
- }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement