Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Add/Update User Custom Field ACF Repeater Sub field WordPress

  • REFUNDED

Form contains donation and project select field , upon submission of the form the sub field created with acf repeater should create a new row containing project and donation select field value


add_action("gform_after_submission_2", "after_donation", 10,2);
function after_donation($entry,$form){
global $current_user;
get_currentuserinfo();
$user_ID = get_current_user_id();

$amount_donated = $entry["1"];
$project_donated = $entry["4"];

Create New Row Data on ACF Repeater Sub Field upon gravity form submission

if( have_rows('user_projects','user_'.$user_ID) ) {



while( have_rows('user_projects') ) {

the_row();


update_sub_field( array('user_projects', 1, 'project_donated'), $project_donated );


}

}



}

http://screencast.com/t/ly26pGvlF

Answers (1)

2014-05-10

Hariprasad Vijayan answers:

Hi,

Are you trying to updated those details in to a post's meta?


jefrey landicho comments:

user meta not post

Form Data (inputted by user)- > Send Data to variables - Create/Add row based on user Meta based on the form selected by the current user


jefrey landicho comments:

Basically ,my question is how would a store the data by row in the user custom field created in ACF. See screenshot for details