This simple snippet allows you to close comments on posts created via a Gravity Form.
/** | |
* 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; | |
} |
Did this resource help you do something awesome with Gravity Forms? Then you'll absolutely love Gravity Perks; a suite of 32+ essential add-ons for Gravity Forms with support you can count on.
This would only close comments from one GF created post/form, yes?
This would close comments on each created by the form ID your specify in the filter name or all forms if you remove the form ID completely from the filter name.
It would only impact posts created after the snippet is implemented.