Skip to content

Instantly share code, notes, and snippets.

@kasparsd
Created October 2, 2015 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasparsd/26d679bd0852ffc7fc91 to your computer and use it in GitHub Desktop.
Save kasparsd/26d679bd0852ffc7fc91 to your computer and use it in GitHub Desktop.
Disable form submissions storage for a form ID
<?php
add_action( 'wpcf7_before_send_mail', function( $cf7 ) {
// Disable form submission for form ID 123
if ( 123 == $cf7->id() ) {
remove_action( 'wpcf7_before_send_mail', array( cf7_storage::instance(), 'storage_capture' ) );
}
}, 5, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment