Created
September 13, 2012 00:22
-
-
Save spivurno/3710956 to your computer and use it in GitHub Desktop.
Gravity Wiz // Close Comments when Post Created via Gravity Forms
This file contains 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
/** | |
* Close Comments when Post Created via Gravity Forms | |
* http://gravitywiz.com/2012/04/25/close-comments-when-post-created-via-gravity-forms/ | |
*/ | |
// update the '6' to the ID of your form | |
add_filter('gform_post_data_6', 'gform_close_comments'); | |
function gform_close_comments($post_data){ | |
$post_data['comment_status'] = 'closed'; | |
return $post_data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👉 This Gist has been migrated to the Gravity Wiz Snippet Library:
https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-close-comments-on-post-creation.php