Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gravity Wiz // Set Post Status by Field Value
/**
* Set Post Status by Field Value
* http://gravitywiz.com/2012/05/04/set-post-status-by-field-value/
*/
// update "3" to the ID of your form
add_filter('gform_post_data_3', 'gform_dynamic_post_status', 10, 3);
function gform_dynamic_post_status($post_data, $form, $entry) {
// update "5" to the ID of your custom post status field
if($entry[5])
$post_data['post_status'] = $entry[5];
return $post_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.