Title: More conditional logic&#8230;
Last modified: August 22, 2016

---

# More conditional logic…

 *  Resolved [andrewg4u](https://wordpress.org/support/users/andrewg4u/)
 * (@andrewg4u)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/more-conditional-logic/)
 * Hello! I’ve seen some posts about conditional logic, and I know you can do a 
   lot of this stuff in the hooks section, but figuring out the right code for what
   I want to do is the issue…
 * I want to do something which is probably pretty simple. I basically want to do
   this:
 * IF “field1” = “value1” THEN don’t send “field2”
    IF “field1” = “value2” THEN 
   don’t send “field3”
 * Or if it’s quicker to just say…
    IF “field2” is empty THEND don’t send it
 * Any help is much appreciated! Thank you!
 * [https://wordpress.org/plugins/forms-3rdparty-integration/](https://wordpress.org/plugins/forms-3rdparty-integration/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/more-conditional-logic/#post-5723987)
 * Did you see the question right below yours?
 * [https://wordpress.org/support/topic/conditional-logic-feature?replies=6#post-6434793](https://wordpress.org/support/topic/conditional-logic-feature?replies=6#post-6434793)
 * Please let me know if that answer was confusing.
 *  Thread Starter [andrewg4u](https://wordpress.org/support/users/andrewg4u/)
 * (@andrewg4u)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/more-conditional-logic/#post-5723992)
 * Hi, thank you for the reply. Yes, I actually did see the post below mine and 
   read through it, but it is still slightly confusing to me.
 * I understand that the user was looking to use conditional logic to not send the
   results to the 3rd party if a certain condition was met… using the response_bypass.
   I just don’t know how to alter that code to make it work for my situation.
 * I still want to post to the 3rd party, I just want to leave out specific fields.
 * I’m sorry to take up your time with these simple questions. Thank you again for
   your time.
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/more-conditional-logic/#post-5724055)
 * Ahhh…sorry, I didn’t read your question right.
 * Your case would be easier — you just need to remove items from the post array
   before they get sent, no bypass necessary.
 * Something like:
 *     ```
       add_filter('Forms3rdPartyIntegration_service_filter_post', 'forms3rdparty_conditional_send', 10, 3);
   
       function forms3rdparty_conditional_send($post, $service, $form) {
           // inspect transformed submission body for presence/lack/value of the desired value
           $field = 'my-conditional-field';
           if( isset($post[$field]) && $post[$field] == 'value-to-ignore') {
               // remove
               unset($post[$field]);
           }
           // return changed filter arg
           return $post;
       }
       ```
   
 * (note the different hook)
 *  Thread Starter [andrewg4u](https://wordpress.org/support/users/andrewg4u/)
 * (@andrewg4u)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/more-conditional-logic/#post-5724075)
 * Yes, this looks like exactly what I need. Thanks again for your help with this!
 * Marking it as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘More conditional logic…’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/forms-3rdparty-integration.svg)
 * [Forms: 3rd-Party Integration](https://wordpress.org/plugins/forms-3rdparty-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forms-3rdparty-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forms-3rdparty-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forms-3rdparty-integration/reviews/)

## Tags

 * [conditional logic](https://wordpress.org/support/topic-tag/conditional-logic/)

 * 4 replies
 * 2 participants
 * Last reply from: [andrewg4u](https://wordpress.org/support/users/andrewg4u/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/more-conditional-logic/#post-5724075)
 * Status: resolved