diff --git a/plugins/fipfcard_plugin/fipfcard_plugin.php b/plugins/fipfcard_plugin/fipfcard_plugin.php index bd8f8f1..e1e2bc3 100644 --- a/plugins/fipfcard_plugin/fipfcard_plugin.php +++ b/plugins/fipfcard_plugin/fipfcard_plugin.php @@ -232,8 +232,6 @@ $_POST "form_id":"modif_profile", "form_type_confirm":"" } -*/ - add_action('parse_request', 'my_custom_url_handler'); function my_custom_url_handler($query) { @@ -249,31 +247,44 @@ function my_custom_url_handler($query) error_log($_POST[$field]); } } +*/ + /** - * in `wp-content/plugins/divi-form-builder/includes/DiviFormBuilder.php` - * Undefined variable: min_length in /var/www/html/wp-content/plugins/divi-form-builder/includes/modules/FormField/FormField.php on line 5933 - * Undefined variable: use_icon in /var/www/html/wp-content/plugins/divi-form-builder/includes/modules/FormField/FormField.php on line 5984 + * do_action( 'df_before_process', string $form_id, Array $post_array, String $form_type ) + * Description: Fires after form is submitted and captcha checking is ok. + * Parameters: + * - $form_id: (String) Form ID from Form setting. + * - $post_array: (Array) Submitted fields from the form. Keys are mapped field names or custom field names (in case of Field Mapping Type is Custom). + * - $form_type : (String) Form Type + * + * wordpress_docker/volumes/wp_volume/wp-content/plugins/divi-form-builder/includes/DiviFormBuilder.php|298 col 18-35| do_action( 'df_before_process', $form_id, $post_array, $form_type ); + * wordpress_docker/volumes/wp_volume/wp-content/plugins/divi-form-builder/includes/ajaxcalls/post_ajax.php|254 col 16-33| do_action( 'df_before_process', $form_id, $post_array, $form_type ); + * + * check user rights : + * - https://developer.wordpress.org/reference/functions/is_user_logged_in/ + * - https://stackoverflow.com/questions/19802492/check-if-current-user-is-administrator-in-wordpress + * - https://developer.wordpress.org/reference/functions/current_user_can/ */ -// function add_my_jquery_patch() -// { -// $fipfcard_tools = new PLGNTLS_class(); -// return $fipfcard_tools->add_to_front -// ( -// array -// ( -// 'de_fb_validate' => 'js/jquery_validator_url_patch.js', -// ) -// ); -// } -// add_action('wp_enqueue_scripts', 'add_my_jquery_patch'); +add_action ('df_before_process', 'PLGNTLS_my_custom_df_form_handler', 10, 3); +function PLGNTLS_my_custom_df_form_handler($form_id, $post_array, $form_type) +{ + error_log("in my_custom_df_form_handler"); + error_log("form_id"); + error_log($form_id); + error_log("post_array"); + error_log(json_encode($post_array)); + error_log("form_type"); + error_log($form_type); +} + // Hook into the 'acf/save_post' action +/* add_action('acf/save_post', 'handle_acf_form_submission', 5); // 20 is the priority, you can adjust it as needed function handle_acf_form_submission($post_id) { error_log("in acf/save_post"); -/* if ($_SERVER['REQUEST_METHOD'] === 'POST' ) { error_log("_SERVER['REQUEST_URI']"); @@ -309,8 +320,8 @@ function handle_acf_form_submission($post_id) $field_value = sanitize_text_field($_POST['your_acf_field_name']); update_field('your_acf_field_name', $field_value, $post_id); } -*/ } +*/ diff --git a/plugins/fipfcard_plugin/js/jquery_validator_url_patch.js b/plugins/fipfcard_plugin/js/jquery_validator_url_patch.js deleted file mode 100644 index f7aeeb1..0000000 --- a/plugins/fipfcard_plugin/js/jquery_validator_url_patch.js +++ /dev/null @@ -1,8 +0,0 @@ -// https://stackoverflow.com/questions/12741517/how-to-make-url-validation-without-http-or-add-it-after-validation-passed/44848476#44848476 - -let old_url = jQuery.validator.methods.url; -jQuery.validator.addMethod( 'url', function(value, element) { - let url = old_url.bind(this); - return url(value, element) || url('http://' + value, element); - }, 'Please enter a valid URL' -); diff --git a/private b/private index 42644f6..82bb18a 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit 42644f633ffb5dcec0cf4c341e113d82fe5b7daa +Subproject commit 82bb18ae1877dd0ef4072cf968bd54bcab4fa899