Display custom meta field in submission wp-admin
-
Hello,
I have two concerns. I am creating and saving pdf on form submission with custom code. now if submission gets deleted, i want to delete my pdf. so for that i have saved the pdf name in the entry meta like displayed in attached screenshot https://prnt.sc/Rx83xkE7TN3g . Now, another thing is I want to display this PDF and Register_number in the submission data in the backend. Guide me through this. I have tried some hooks but not able to get successful results. so provide me the hooks for this https://prnt.sc/dkmAtLvxxg5x .
I also want to start my submission id with 0001 and it will be autoincremented as soon as user fill up the form.- This topic was modified 2 months ago by riyaseasternts.
- This topic was modified 2 months ago by riyaseasternts.
-
I hope you’re well today!
As for displaying that data:
It’s not quite simple and will require quite a bit of custom code. You would need to look into these filters:
forminator_custom_form_build_fields_mappers forminator_fields_mappers forminator_custom_form_entries_iterator
As for the submission ID:
Those IDs are not generated by Forminator but by the DB engine. Forminator makes use of the “auto-increment” SQL feature so the IDs are automatically generated by the DB and Forminator has no any impact on that. It only uses/reads them.
This cannot be changed but you could possibly use custom code to add another ID that would be automatically generated by the script and saved with submission. This also requires custom development. In the past I had a code for similar task created so you can built upon it:
https://gist.github.com/adczk/fbf06b6abf7753df6b37234b13041e79
Note though:
1. I cannot guarantee that this code will still work fine with current Forminator version as it was last tested with 1.15.2 version of the plugin. You are, however, free to modify it so it would be good start for your own custom development.
2. Any custom development is out of the scope of this support (that includes modifications and updates of shared code or providing any new custom code) so this is as far as we can go with it.
Kind regards,
AdamThank you for you response.
you didn’t answer for PDF deleting concern.
Moreover for submission increment, I got your point. I will make require changes to the database for this.you didn’t answer for PDF deleting concern.
You’re right, I’m sorry I skipped that.
However, that also is very specific. By default, Forminator doesn’t save generated PDFs. It only generates them “on the fly” when they are about to be displayed/attached to e-mail – so they are kind of “temporary”.
As you already mentioned, you are saving them with custom code (as otherwise they wouldn’t be permanently saved) and it would also take another custom code (or modification of the one you are using) to delete them upon submission deletion. Yet, we do not provide any kind of custom code and custom development assistance currently, I’m afraid.
Kind regards,
AdamHello,
Thanks for the response. But if you can provide the hook for deleting the entry then it will be great. I have tried fews but not able to find “entry_id” in some of the hooksHope this message finds you well.
You will need the hooks before deleting the entries, these are the hooks:
forminator_before_delete_entries forminator_before_delete_entry
But it will require also a combination with a method from our API https://wpmudev.com/docs/api-plugin-development/forminator-api-docs/#method-get_entry
Hope this can help.
Best regards,
LauraHello,
Thank you for the help. Do you have any hook asI need to store the form data in my custom table. If you can share the hooks and filters documentation, then it will be great.- This reply was modified 1 month, 3 weeks ago by riyaseasternts.
Sorry to say, but you dont’ have a proper developer’s document which helps to find the hooks/filters easily.
Also, i want to store my file upload data in the custom folder and it should be different according to the forms. is it possible?
Let me know ASAP.Hello @riyaseasternts
Please avoid sending multiple responses since we reply to older topics first, it can delay the response time.
Do you have any hook asI need to store the form data in my custom table. If you can share the hooks and filters documentation, then it will be great.
You can use this hook to retrieve the data when a form is submitted and use your custom functions to store the data inside custom tables.
forminator_custom_form_submit_field_data
Also, i want to store my file upload data in the custom folder and it should be different according to the forms. is it possible?
You may use this hook to change the uploads folder, I’m afraid we don’t have a document about how to use that but if you search in plugin files you should find more information about it.
forminator_custom_upload_subfolder
Best Regards,
AminHi,
forminator_custom_upload_subfolder
this is not working. Also, my requirement is to upload the file to the custom folder inside the wp-content/uploads/ folder with renaming the file. but somehow move_uploaded_file is not working.Hello @riyaseasternts
Hope you’re doing well today!
As I checked,
forminator_custom_upload_subfolder
is a valid hook and should ideally work fine. Would it be possible to share the code snippet you are trying to use so that we can have a quick look to see if anything is missing?However, that said, as mentioned by Adam in the initial reply what you are trying to achieve would require custom code and modifications to the default form functionality and providing a new custom code would fall under custom development and would be out of our support scope I am afraid.
Kind Regards,
SaurabhHi, I did use your provided filter, but it didn’t work. Check the screenshot : https://prnt.sc/Ux0CTHodHMNa
Check the screenshot for the current code which is not uploading the file to custom folder. There is no error showing anywhere. https://prnt.sc/A6JlBQvhsggu
Also, when I am changing the folder from the plugin’s settings, it is recreating the folder inside my custom folder. https://prnt.sc/SuPe2N3COip7
Please let me know your thoughts ASAP.- This reply was modified 1 month, 3 weeks ago by riyaseasternts.
It’s really irritating that you don’t have documentation for your plugin’s hook. and it is really irritating that your hooks are not working at all. I want to redirect my users to ccavenue payment gateway but none of the hooks are working and not able to find more hooks now. And now you will say don’t add multiple comments, but you are not replying and I am facing multiple issues day after another. so please now respond quickly. i thought you will be the great plugin but now i am facing so much issues that I am planning now to switch to contact form7 plugin
- This reply was modified 1 month, 3 weeks ago by riyaseasternts.
- This reply was modified 1 month, 3 weeks ago by riyaseasternts.
Hi @riyaseasternts,
I’m afraid at the moment these are the only available documentation for the plugin:
https://wpmudev.com/docs/api-plugin-development/forminator-api-docs/
Other than that, it’ll require going through the plugin code and manually checking how it works to make use of hooks.
As suggested the hooks provided are correct, unfortunately just checking the mentioned specifics doesn’t help in giving much information on what’s wrong in the code.
I’m afraid what we could suggest is to use the default functionality ie to add the custom folder as shown here:
So that you can set the subfolder name to an empty string using
forminator_custom_upload_subfolder
filter, effectively directing uploads to the base directory defined in the plugin’s settings.$sub_folder = '';
return $sub_folder;So that all the file of the upload fields will be uploaded to the volunteer folder instead of creating the form_random_ids folder inside the custom folder.
However, I’m afraid what we could suggest more in the custom code is limited and is outside our support scope. For that, you’ll need to hire a developer to provide the required custom code for you. WordPress provides a jobs directory here:
If you need further advice about it, feel free to email
[email protected]
.Subject: ATTN: WPMU DEV support – wp.org”
Regards,
Nithin
Hello,
Thank you for your reply. But you didn’t reply for the CCAvenue payment gateway integration.
Moreover, I will make the changes for subfolder, but what about photo name? I have custom name stored in my database in my custom table. and it stores the photo with {id_photoname} . This name is stored in the database. How should I upload the same image in uploads folder?
- You must be logged in to reply to this topic.