複雑なGravityフォームが構築されていますが、それは10ページあります。フィールドを使用して "文字列"を作成し、CPT名と一致させてメタデータを取得し、ユーザーの選択肢に基づいて選択肢を表示します。Gravity Forms複数ページPOST値を失う
私が持っている1つのフィールドはPOSTでその値を保持していません。私はページ上の値を選択したときにそれを見ることができます。そして、次のページにクリックすると値はまだそこにあります。ただし、2ページ後に値(およびフィールド)がPOSTから消えます。
これは私の製品ストリングを構築するための機能です。問題のPOST disappearing..The POSTフィールドを示す
add_filter('gform_pre_render_12', 'display_choice_result');
function display_choice_result($form) {
$current_page = GFFormDisplay::get_current_page($form['id']);
$html_content = "";
$prod_string = "";
if ($current_page >= 10) {
foreach ($form['fields'] as &$field) {
// Check for a class of "product-builder-item" on the field
// I use this as another way to denote what fields to add to string
if (strpos($field->cssClass, 'product-builder-item') === false) {
continue;
}
//gather form data to save into html field (Field ID 14 on Form ID 12)
//exclude page break and any hidden fields
if ($field->id != 14 && $field->type != 'page') {
$is_hidden = RGFormsModel::is_field_hidden($form, $field, array());
$populated = rgpost('input_' . $field->id);
// Make sure the field we are getting the value from is not hidden and has a value
if (!$is_hidden && $populated !='') {
$html_content .= '<li>' . $field->label . ': ' . rgpost('input_' . $field->id) . '</li>';
$prod_string .= rgpost('input_' . $field->id);
}
}
}
// Do a bunch of stuff here with the $prod_string variable
// ...
// ...
// ...
}
return $form;
}
スクリーンショット私は
フィールドから選択した後、これは1ページですの値であるinput_22
の後に2つのページがあります。
誰もがこれまでに実行されているか、それが消えてしまう理由を知っていますか?
ありがとうございます。
これを解決できましたか?同様の状況に陥っている。 – kisabelle