Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author bgermann

    (@bgermann)

    Please have a look at my-functions.php.txt. Most probably you want to go for my_cforms_filter(). I plan to move to WordPress actions/filters sometime. Your request could be the reason for me to do it in the near future as your plugin has functionality I could strip off in cformsII if you integrate it.

    Thread Starter Michael Simpson

    (@msimpson)

    I’m glad you are open to the idea.

    I tried my_forms_filter. I did a sample submission and printed out the args (below). It looks like the $track global var has all the form submission values. But $formIDOrPostData seems to be blank. Ideally I would like to get a form name as well as the data passed in a call to do_action() or apply_filters(). How would I get a title?

    I don’t know if on your end it is a straight-forward as adding a do_action call everywhere you currently have my_cforms_filter call.

    I haven’t looked at how file uploads are captured in your data structure yet. And I haven’t looked at how multi-step forms work.

    Let me know what you think.

    $formIDOrPostData:
    $track:Array
    (
        [$$$1] => New Field
        [New Field] => stuff
        [$$$2] => Fieldset1
        [Fieldset1] => My Fieldset
        [$$$3] => Your Name
        [Your Name] => Mike
        [$$$4] => Email
        [Email] => mike@example.com
        [$$$5] => Website
        [Website] => http://www.example.com
        [$$$6] => Message
        [Message] => hi there
    how are you?
    )
    Plugin Author bgermann

    (@bgermann)

    I am sorry for the delay. I have seen you managed to get beta cformsII support in your plugin and answered the questions about the title and the blank $formIDOrPostData yourself.

    I will figure out if it is possible to add better support for uploads in an upcoming my_cforms_filter WordPress filter. As I mentioned: With the release of stable cforms support in your plugin I want to get rid of storing the data in cformsII as that adds a huge amount of complexity in the current codebase (which only a little amount of is mine).

    I have to figure out the multi-step forms as well. That is one part of cformsII I have not dealt with in deep.

    Thread Starter Michael Simpson

    (@msimpson)

    Thanks for getting back to me.

    It would be great if you created an action hook that I could use to get all the form data instead of having to peek into your plugin’s options to get the form name. I’d like to minimize dependencies on the internal workings of your plugin’s code.

    If you add me as a developer to your plugin, I’ll create a branch and add some code as a suggestion.

    Thanks.

    Plugin Author bgermann

    (@bgermann)

    Instead of calling my my_cforms_action, I have introduced cforms2_after_processing_action, added “title” index and will add “uploaded_files” index.

    You can hand in GitHub pull requests at https://github.com/bgermann/cforms2 where the above mentioned changes were made at branch “dev”.

    Thread Starter Michael Simpson

    (@msimpson)

    I see you released and update with that code. I plan to update CFDB to match. I want to test an upload field, but whenever I add a field to a form, then the form no longer displays in the post (where I put a shortcode to display it). I don’t know what the problem is.

    The hook does work, but I can’t see what the data structure is inside $trackf[‘uploaded_files’]. I’m trying to setup code like the following. Can you fill in the blanks for me?

    foreach ($trackf['uploaded_files'] as $file) {
        $file_name = $file['name'];
        $field_name = // TODO: how to get the form field name?
        $file_path =     // TODO: how to get the path to where the file is?
    }

    Plugin Author bgermann

    (@bgermann)

    I am sorry for not taking this on so long. I just want to note that it is still on my list and I need to rework some more things to guarantee a clean interface.

    Plugin Author bgermann

    (@bgermann)

    Finally I created a GitHub pull request for this one. In the next cformsII version there will be an export to CFDB tool available, which you can check out at my git master branch. This tool will export the commiter’s IP address additionally. It was not obvious for me how to add it to you database, so I added a TODO.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hook to get form submission data’ is closed to new replies.