2016-07-12 12 views
0

を更新するには:重力フォームこの記事次以前に入力したエントリ

http://techslides.com/editing-gravity-forms-entries-on-the-front-end

提出を更新するのではなく、新しいものを作成するために、重力のフォームを取得しようとしています。

問題は、コードの

/* https://www.gravityhelp.com/documentation/article/gform_pre_submission */ 
add_action("gform_pre_submission", "pre_submission_handler"); 
function pre_submission_handler($form){ 

if (strpos($_SERVER['REQUEST_URI'], 'application-edit', 0) !== false) { 
    //Get original entry id 
    parse_str($_SERVER['QUERY_STRING']); //will be stored in $entry 

    //get the actual entry we want to edit 
    $editentry = GFAPI::get_entry($entry); 

    //make changes to it from new values in $_POST, this shows only the first field update 
    $editentry[1]=$_POST['input_1']; 

    //update it 
    $updateit = GFAPI::update_entry($editentry); 

    header("Location: http://yourdomain.com/apply/application-thank-you/"); 

    //dont process and create new entry 
    die(); 
} 

} 

セクションで、ヘッダリダイレクトが機能していないことです。助言がありますか?

答えて

関連する問題