Problem:
Change the CRED form parent select dropdown into a hidden field.
Solution:
there isn't such a built-in feature. as a workaround you can use a generic hidden field to replace the select dropdown field, for example:
[cred_generic_field field='_wpcf_belongs_product-listing_id' type='hidden' class='' urlparam='productid'] { "required":0, "validate_format":0, "default":"0" } [/cred_generic_field]
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_generic_field
Then update the field value with CRED action hook "cred_save_data", for example:
add_action('cred_save_data', 'my_save_data_action',10,2); function my_save_data_action($post_id, $form_data) { // if a specific form if ($form_data['id']==123) { if (isset($_POST['_wpcf_belongs_product-listing_id'])) { // add it to saved post meta update_post_meta($post_id, '_wpcf_belongs_product-listing_id', $_POST['_wpcf_belongs_product-listing_id'], true); } } }
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Hong_Kong (GMT+08:00)
Dieses Thema enthält 3 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von vor 6 Jahren, 6 Monaten.
Assistiert von: Luo Yang.