[all-fields] Author: Katz Web Services, Inc. Author URI: http://www.katz.co Version: 2.0.2 Text Domain: cf7_modules Domain Path: languages License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html */ add_filter('wpcf7_mail_components', 'all_fields_wpcf7_before_send_mail'); function all_fields_wpcf7_before_send_mail($array) { $debug = false; if ( $debug ) { print_r( $array ); } if ( $debug ) { print_r( $_POST ); } $post = $_POST; $html = false; if ( wpautop( $array['body'] ) == $array['body'] ) { $html = true; } foreach ( $post as $k => $v ) { if ( substr( $k, 0, 6 ) == '_wpcf7' || strpos( $k, 'all-fields' ) || $k === '_wpnonce' ) { unset( $post["{$k}"] ); } } if ( $debug ) { print_r( $post ); } $postbody = ''; if ( $html ) { $postbody = apply_filters( 'wpcf7_send_all_fields_format_before', '
[all-fields]
', $postbody, str_replace( '[all-fields]', $postbody, $array['body'] ) ); if ( $debug ) { die(); } else { return $array; } } add_filter('wpcf7_collect_mail_tags', 'wpcf7_collect_mail_tags_add_all_fields_tag'); /** * Add a all-fields option to the Mail tab's merge tags * @since 2.0 * @param array $mailtags */ function wpcf7_collect_mail_tags_add_all_fields_tag( $mailtags = array() ) { $mailtags[] = 'all-fields'; return $mailtags; }