I have a custom field called _my_description
The idea is when a form is submitted the data from the form is also put into this field.
Here's my code
add_action( 'gform_post_submission_10', 'set_post_content', 10, 2 );
function set_post_content( $entry, $form ) {
$post = get_post( $entry['post_id'] );
$post-> _my_description = $entry[1] . ', ' . $entry[11] . ', ' . $entry[14] . ', ' . $entry[13] . ', ' . $entry[12] . ', ' . $entry[16] . ', ' . $entry[15] . $entry[19];
update_post_meta( $post );
}
If I have it go to the post_content with wp_update_post it works fine, but trying to get it to go to a custom field it wont work. The fields were created using this plugin http://justcustomfields.com/ Anyone see why this isn't working please?
Fixed Thanks If anyone needs the code in future here it is
add_action( 'gform_post_submission_10', 'set_post_content', 10, 2 );
function set_post_content( $entry, $form ) {
$post = get_post( $entry['post_id'] );
update_post_meta( $post->ID, '_my_description', $entry[1] . ', ' . $entry[11] . ', ' . $entry[14] . ', ' . $entry[13] . ', ' . $entry[12] . ', ' . $entry[16] . ', ' . $entry[15] . $entry[19] );
}