6n15
Forum Replies Created
-
Hello.
I tried the snippet you provided and it worked just as I wanted it to.
I appreciate you listening to my problem and trying to solve it. I hope Forminator will become a favorite plugin for many more people. I wish you all the best ??Thanks
Thank you so much for the snippet.
But due to my special situation, I can’t ftp access the wp-content folder or install the mu-plugin in any way, is it possible to use the code you gave me with a snippet plugin like “WP Code”?I’ve uploaded the screenshots to the Google Drive folder I shared with you when I sent you the export data. The link above is the same link I shared with you. I guess I didn’t explain enough in my last reply.
Inside the Google Drive folder in the link above, there is a video called “issue recording”, which you can refer to.
Thanks.Yes, I am using the correct taxonomy id.
To help you understand the exact issue, I’ve uploaded the screenshot video to the Google Drive folder I shared earlier. I hope this helps ??Thank you very much. I look forward to your response.
I’ve exported and uploaded the data.
The idea was to create 3 forms for each type and implement them as mentioned above (with each id value in a hidden field in each form)
Because of the Korean language, I’ll explain a bit for quick understanding,
Custom Post Type = Patients Messages
Custom Taxonomy = Message Types
(There are three types)
-> msg-pregnancy, id value=34
-> msg-birth, id value=35
-> msg-thanks, id value=36Originally, I could’ve made the form user allow to specify the message type within the post data as a basic feature of Forminator, but I chose to do it by custom field because different message types require different fields to be visible. If I could apply conditional logic based on the message type to set the visibility of the fields, I wouldn’t need to map them as hidden fields.
If this is a simpler way to do, I would really appreciate any help on this. But if it’s not, just forget what I said ??
It’s been so much more than I expected and I’m very grateful for your response.Thanks for your thoughtful response.
The example you gave at the end seems similar to what I’m trying to do, and I was wrong about the checkboxes, sorry.
To clarify,
I have mapped a hidden field in the form by Forminator to a custom field by ACF (-this custom field is taxonomy type and its appearance is single-select, not checkbox), and I have written a custom taxonomy id value (ex.34) in the hidden field.After submission, if I verify the post directly on the editor page, the custom field in the ACF(that is single-select type) has already been applied to match the submitted taxonomy ID value. However, the checkbox inside the meta box for the custom taxonomy is not checked. And when I update the post, the taxonomy that matches the submitted taxonomy ID is checked by itself.
Is this a completely different issue than before?
I haven’t tried your code yet. And again, sorry for the misinformation.Thanks for your effort,
I have a snippet that they provided when I contacted ACF, and I’m attaching it in case it helps.
The code below is what they told me I could use to try to update the field if the forminator has a filter. (I’m not a coder, I know just basic HTML/CSS. I just hope this helps a bit)/**
* Updates top level array based field to ensure it has field key save in post meta
*
* @param mixed $field_name the name of the top level field to be updated
* @param mixed $post_id the id of the post or WP object
* @return void
*/
function reupdate_array_based_field_with_its_value($field_name,$post_id){
$field_value=get_field($field_name, $post_id, false);//third parametr to false to avoid formating
update_field($field_name,array(),$post_id);//update the field with empty value so that we can update it with the right value. The change of value will ensure the field key is saved.
update_field($field_name,$field_value,$post_id);//now update with the real value
}
//usage: reupdate_array_based_field_with_its_value('field_name',123);