Skip to content

Instantly share code, notes, and snippets.

@asllanmaciel
Created August 23, 2021 18:33
Show Gist options
  • Save asllanmaciel/904f0cadfe55b82ab02c1ee537280618 to your computer and use it in GitHub Desktop.
Save asllanmaciel/904f0cadfe55b82ab02c1ee537280618 to your computer and use it in GitHub Desktop.
Send fields from Elementor to script
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