Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. <?php
  2. /**
  3. * Set the default comment status for events to 'closed'.
  4. *
  5. * Could easily be adapted to target all post types or a different
  6. * post type.
  7. */
  8. add_filter( 'get_default_comment_status', function( $status, $post_type ) {
  9. if ( 'tribe_events' !== $post_type ) {
  10. return $status;
  11. }
  12.  
  13. return 'closed';
  14. }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement