Filip Fryčák
Forum Replies Created
-
Forum: Reviews
In reply to: [Post My CF7 Form] Such a life saver, great plugin and awesome supportthis is possible. please read FAQ #3
Ahh, I take my words back. This works! Great, thank you once more.
Forum: Plugins
In reply to: [Post My CF7 Form] Mapping form field to ACF via value, not labelJust tried the pipes functionality and it worked perfectly.
Or almost perfectly… In ACF settings, when the Allow Null is checked, the result in ACF when sent from CF7 is somehow always Null. Even if the form is set correctly, whatever option is chosen in form by user, in ACF in WordPress Administration, the result is always Null.
When I uncheck Allow Null, it works fine.
This is not ideal, but it is also not crucial for me and I can handle this other way.
Thank you so much for great support @aurovrata. Have a great day!
- This reply was modified 5 years, 3 months ago by Filip Fryčák.
Forum: Plugins
In reply to: [Post My CF7 Form] Mapping form field to ACF via value, not labelHave you tried using CF7 plugin’s pipes functionality?
Well, didn’t know about this feature. This looks really promising. I am going to try it this way. Would be a nice way to solve the issue.
Thank you for the recommendation. I will let you know whether it worked for me.
that would be one way to go about it, but not very efficient as it means all your values are hardcoded and not very easy to maintain.
True and agreed. Gonna keep this solution as a backup plan, if nothing else would work.
- This reply was modified 5 years, 3 months ago by Filip Fryčák.
Forum: Plugins
In reply to: [Post My CF7 Form] Mapping form field to ACF via value, not labelHello @aurovrata,
thank you for quick support and answer. Yes, I read that in other topics, but wondered if I am doing everything correctly.
Here is the way I use: https://imgur.com/8w8b9W6
To programmatically format the values is good point! So you suggest something like this (in pseudo) (AFC names are different):
if (value == "Radio Station") {value = "radio";} elseif (value == "Newspaper") {value = "paper";} elseif (value == "Television") {value = "tv";} etc.In other words, rewriting the “label value” to “value value”. This should not be a problem with use of this code from documentation, right?
add_filter('cf7_2_post_filter-quick-contact-age','filter_date_to_age',10,3); function filter_date_to_age($value, $post_id, $form_data){ //$value is the post field value to return, by default it is empty //$post_id is the ID of the post to which the form values are being mapped to // $form_data is the submitted form data as an array of field-name=>value pairs if(isset($form_data['date-of-birth']){ //calculate the age $value = .... } return $value; }Hello @wpallimport,
I tried it and it worked perfectly. So this solves the issue.
Unfortunately, I can’t use the value : label in ACF. I am forced to use only the label because of other plugin, which does not support value : label.
So I am still stuck, but the question was pretty much answered. So thank you so much anyway.
- This reply was modified 5 years, 3 months ago by Filip Fryčák.