Skip to content

Instantly share code, notes, and snippets.

@robinbastien
Last active August 29, 2015 14:07
Show Gist options
  • Save robinbastien/be0754fb8150cf194470 to your computer and use it in GitHub Desktop.
Save robinbastien/be0754fb8150cf194470 to your computer and use it in GitHub Desktop.
Gravity Forms sample user meta
<?php
/**
* Save the confirmation number of the wire transfer to the user's meta
*/
add_action("gform_after_submission_12", "save_wire_transfer", 10, 2);
function save_wire_transfer($entry, $form){
$current_user = wp_get_current_user();
$user_id = $current_user->id;
//getting post
$post = get_post($entry["post_id"]);
$content = $entry[2.1];
//changing post content
if( isset($entry[2.1]) ) {
update_user_meta( $user_id , 'wire_transfer' , $content , false );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment