Created
April 11, 2019 22:21
-
-
Save barryhughes/928e3bb39c3fda803fde0eca030038c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment