Viewing 2 reply threads
  • Author
    Posts
    • #7400
      freezingfire
      Participant

      Hi,

      I’m trying to perform a custom WordPress action using a frontend form (I don’t want to save any data just perform a custom action after submission) but cannot find anything helpful in the documentation to help me do so. There’s a param called “Action”, but its undocumented : https://piklist.com/learn/doc/forms/.

      Is this possible with the current version of Piklist? I’ve tried the following config and added an action called ‘something_todo’ but nothing happens.

      <?php
      /*
      Title: Register
      Method: post
      Message: Each option has been updated.
      Logged in: false
      Action: something_todo
      */

    • #7408
      tirins007
      Participant

      Couldn’t you use “wp_insert_post_data” filter that is called before a post is saved and then manipulate the submission however you wanted. you’d then need to specify “Scope: post” in the comment block of your form and the data will be saved to posts table. but if you did not want to save anything just call “return;”. Hope it helps.

    • #7410
      jrcreative
      Member

      @tirins007’s idea would work, but it would create an empty post for each form submission.

      Handling POST Requests the WordPress Way

      I haven’t married the info in the article above with a Piklist front end form, so this is a bit theoretical, but it should get you in the right direction. At some point I’d like to write this specifically into the Piklist docs, but until then this is where I’d start.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.