Hey there,
I have a similar issue as the open request at:
http://www.gravityhelp.com/forums/topic/add_action-upon-post-published-with-custom-field
We have added an action to the "save_post" action to update the post category based on values saved on two custom post fields (we need to support two different searching methods, hence the duplication of info on a single post). The code below works when we save a post through the admin UI:
function update_category($post_id ) {
$cat_ids = array( get_post_meta($post_id, place_type, true) , get_post_meta($post_id, location, true) );
wp_set_object_terms( $post_id, $cat_ids, 'category');
}
add_action('save_post', 'update_category');
However, when the post is created through the Gravity Form submission, the custom fields are populated based on two questions mapped to those two fields, but the corresponding categories aren't updated. Opening the post as an admin and simply click "Update" without applying any changes causes the action to fire. Any idea what we might be doing wrong here?
Thanks!