PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Trigger event after submit on form

  1. twessel
    Member

    Howdy. I'm using a plugin that generates a post thumbnail automatically when a post with a URL is submitted. It's called Video Thumbnails (http://sutherlandboswell.com/2010/11/wordpress-video-thumbnails/). It works on the backend but on my front-end form it doesn't. Do I need to call function or script when submit is clicked on the front-end in order for it to work properly? Thanks!

    Posted 12 years ago on Monday June 20, 2011 | Permalink
  2. Yes, you'd probably have to call a function of some sort to trigger this plugin. It's not going to happen automatically. How comfortable are you with PHP and WordPress development using hooks and filters? The first thing you'd need to do is be familiar with how that plugin works and how you could trigger it's functionality using code.

    Posted 12 years ago on Monday June 20, 2011 | Permalink
  3. twessel
    Member

    Hmmm. Not very familiar. It's a single file plugin so maybe I can look around or ask the author unless you have an example. I understand it's not your job though. Anyway, thanks for a nice plugin. Very simple to get going.

    Posted 12 years ago on Tuesday June 21, 2011 | Permalink
  4. twessel
    Member

    Ok, here's the function for that plugin that needs to be triggered 'get_video_thumbnail($post_id)'.

    I'm trying to get this to "trigger" when the form is submitted. Do I add it to the function.php with this? Am I missing anything else? Sorry for being such a noob.

    'add_filter("gform_submit_button", "form_submit_button", 10, 2);
    function form_submit_button($button, $form){
    return "<button class='button' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
    }'

    Posted 12 years ago on Thursday June 23, 2011 | Permalink
  5. You would have to use the gform_post_submission hook to trigger that function call when the form is submitted. Your custom code would go in your themes functions.php file. It sounds like you may want to hire a developer to assist you with this, you don't need to use the gform_submit_button hook. So you may want to hire someone that fully understands how to use hooks/filters to assist you with this customization.

    Posted 12 years ago on Thursday June 23, 2011 | Permalink

This topic has been resolved and has been closed to new replies.