Problem: I have a Form that is used to create child post in a one-to-many post relationship. I would like to get the value of a custom field from the related parent post in a cred_save_data callback, but it does not seem to be working.
Solution: The relationship is not yet set in a cred_save_data hook, so you can either use the cred_submit_complete hook instead, or access the parent post ID directly from the parent select field in the $_POST superglobal.
$parent_post_id = $_POST['@relationshipslug_parent']; $parent_field_value = get_post_meta( $parent_post_id, 'wpcf-fieldslug', true);
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 7 replies, has 2 voices.
Last updated by 3 years, 9 months ago.
Assisted by: Christian Cox.