Skip to content

Commit 355c7b3

Browse files
authored
Merge pull request #14 from codeccoop/feat/formidable
formidable forms integration
2 parents d71dbdb + 56234f2 commit 355c7b3

18 files changed

+1480
-41
lines changed

bin/download-test-deps.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ else
1313
mkdir -p "$WORDPRESS_DIR/wp-content/mu-plugins"
1414
fi
1515

16-
URLS=('https://downloads.wordpress.org/plugin/contact-form-7.6.1.3.zip'
17-
'https://downloads.wordpress.org/plugin/ninja-forms.3.13.0.zip'
18-
'https://www.codeccoop.org/formsbridge/plugins/wpforms.zip'
16+
URLS=('https://downloads.wordpress.org/plugin/contact-form-7.6.1.4.zip'
17+
'https://downloads.wordpress.org/plugin/formidable.6.26.1.zip'
1918
'https://www.codeccoop.org/formsbridge/plugins/gravityforms.zip'
20-
'https://downloads.wordpress.org/plugin/woocommerce.10.3.4.zip')
19+
'https://downloads.wordpress.org/plugin/ninja-forms.3.13.3.zip'
20+
'https://downloads.wordpress.org/plugin/woocommerce.10.4.3.zip'
21+
'https://downloads.wordpress.org/plugin/wpforms-lite.1.9.8.7.zip')
2122

22-
PLUGINS=('contact-form-7' 'gravityforms' 'ninja-forms' 'wpforms', 'woocommerce')
23+
PLUGINS=('contact-form-7' 'formidable' 'gravityforms' 'ninja-forms' 'woocommerce' 'wpforms-lite')
2324

2425
COUNT=${#PLUGINS[@]}
2526

forms-bridge/includes/class-form-bridge-template.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ static function ( $field ) {
927927

928928
if ( 'woo' === $integration ) {
929929
$data['form']['id'] = 1;
930-
} elseif ( 'wpforms' === $integration ) {
930+
} elseif ( in_array( $integration, array( 'wpforms', 'formidable' ), true ) ) {
931931
$mappers = array();
932932
foreach ( $data['form']['fields'] as &$field ) {
933933
if ( 'file' !== $field['type'] ) {
@@ -1005,9 +1005,7 @@ static function ( $field ) {
10051005

10061006
if ( ! $result ) {
10071007
if ( $create_form ) {
1008-
$integration_instance->remove_form(
1009-
$data['form']['id']
1010-
);
1008+
$integration_instance->remove_form( $data['form']['id'] );
10111009
}
10121010

10131011
return new WP_Error(
@@ -1060,9 +1058,7 @@ static function ( $field ) {
10601058

10611059
if ( ! $bridge_created ) {
10621060
if ( $create_form ) {
1063-
$integration_instance->remove_form(
1064-
$data['bridge']['form_id']
1065-
);
1061+
$integration_instance->remove_form( $data['form']['id'] );
10661062
}
10671063

10681064
if ( $create_credential ) {

forms-bridge/includes/class-integration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ private static function check_dependencies( $integration ) {
7070
case 'woo':
7171
$deps = array( 'woocommerce/woocommerce.php' );
7272
break;
73+
case 'formidable':
74+
$deps = array( 'formidable/formidable.php' );
75+
break;
7376
default:
7477
return false;
7578
}

0 commit comments

Comments
 (0)