Last active
August 29, 2015 14:07
-
-
Save robinbastien/be0754fb8150cf194470 to your computer and use it in GitHub Desktop.
Gravity Forms sample user meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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