Created
August 23, 2021 18:33
-
-
Save asllanmaciel/904f0cadfe55b82ab02c1ee537280618 to your computer and use it in GitHub Desktop.
Send fields from Elementor to script
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
add_action( 'elementor_pro/forms/new_record', function( $record, $handler ) { | |
$raw_fields = $record->get( 'fields' ); | |
$fields = []; | |
foreach ( $raw_fields as $id => $field ) { | |
$fields[ $id ] = $field['value']; | |
} | |
wp_remote_post( 'http://domain/script/fields.php', [ | |
'body' => $fields, | |
]); | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment