diff --git a/plugins/fipfcard_plugin/fipfcard_plugin.php b/plugins/fipfcard_plugin/fipfcard_plugin.php index 36a75f1..bd8f8f1 100644 --- a/plugins/fipfcard_plugin/fipfcard_plugin.php +++ b/plugins/fipfcard_plugin/fipfcard_plugin.php @@ -233,6 +233,7 @@ $_POST "form_type_confirm":"" } */ + add_action('parse_request', 'my_custom_url_handler'); function my_custom_url_handler($query) { @@ -254,18 +255,18 @@ function my_custom_url_handler($query) * 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 */ -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'); +// 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'); // 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 diff --git a/plugins/formbuilder_url_patch/formbuilder_url_patch.php b/plugins/formbuilder_url_patch/formbuilder_url_patch.php new file mode 100644 index 0000000..74b84bf --- /dev/null +++ b/plugins/formbuilder_url_patch/formbuilder_url_patch.php @@ -0,0 +1,28 @@ + diff --git a/plugins/formbuilder_url_patch/jquery_validator_url_patch.js b/plugins/formbuilder_url_patch/jquery_validator_url_patch.js new file mode 100644 index 0000000..f7aeeb1 --- /dev/null +++ b/plugins/formbuilder_url_patch/jquery_validator_url_patch.js @@ -0,0 +1,8 @@ +// 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/wordpress_docker b/wordpress_docker index c809edb..c1a5293 160000 --- a/wordpress_docker +++ b/wordpress_docker @@ -1 +1 @@ -Subproject commit c809edb4f83b5a2389c449b005a7b39b568fb915 +Subproject commit c1a52938aa86667e7fd726e84721bd04d9f6161a