This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpforms_entry_save_data', static function ( $fields, $entry, $form_data ) { | |
$value1 = ''; | |
$value2 = ''; | |
// These are field IDs to take data from, and to merge into. | |
$field1_id = 1; | |
$field2_id = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpforms_countries', function ( $countries ) { | |
$key_from = 'CA'; | |
if ( array_key_exists( $key_from, $countries ) ) { | |
$keys = array_keys( $countries ); | |
$keys[ array_search( $key_from, $keys, true ) ] = 'Canada'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- This is a skeleton phpDox config file - Check http://phpDox.de for latest version and more info --> | |
<phpdox xmlns="http://xml.phpdox.net/config" silent="false"> | |
<!-- @silent: true | false to enable or disable visual output of progress --> | |
<!-- Additional bootstrap files to load for additional parsers, enrichers and/or engines --> | |
<!-- Place as many require nodes as you feel like in this container --> | |
<!-- syntax: <require file="/path/to/file.php" /> --> | |
<bootstrap /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Make "$40.00 - Second Choice" instead of "Second Choice - $40.00" | |
* for different payment fields. | |
*/ | |
add_filter( 'wpforms_html_field_value', function ( $value, $field, $form_data, $context ) { | |
if ( 'email-html' !== $context ) { | |
return $value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WPForms: Conditional form redirects based on field value. | |
* | |
* @param string $url URL form will redirect to | |
* @param int $form_id Form ID | |
* @param array $fields Submitted form fields | |
* @return string | |
*/ | |
function wpf_custom_redirect( $url, $form_id, $fields ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wp_mail_smtp_custom_options', function( $phpmailer ) { | |
$phpmailer->SMTPOptions = array( | |
'ssl' => array( | |
'verify_peer' => false, | |
'verify_peer_name' => false, | |
'allow_self_signed' => true | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wp_mail_smtp_custom_options', function( $phpmailer ) { | |
$phpmailer->SMTPAutoTLS = false; | |
return $phpmailer; | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpforms_email_headers', function ( $headers, $emails ) { | |
// APPLY THE BCC TO THIS FORM ID ONLY. | |
// CHANGE THE ID TO THE FORM YOU NEED. OR REMOVE THE WHOLE IF BLOCK IF NEEDED FOR ALL FORMS. | |
if ( 384 !== $emails->form_data['id'] ) { | |
return $headers; | |
} | |
// CHANGE THIS EMAIL ADDRESS TO YOURS: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// For WPForms < v1.5.5, but should work with the latest version as well. | |
add_filter( | |
'wpforms_csv_export_separator', | |
function( $sep ) { | |
return ';'; | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpforms_currencies', function( $currencies ) { | |
$currencies['RON'] = array( | |
'name' => __( 'Romanian Leu', 'wpforms' ), | |
'symbol' => ' lei', | |
'symbol_pos' => 'right', | |
'thousands_separator' => ',', | |
'decimal_separator' => '.', | |
'decimals' => 2, |