'Form submitted successfully' ), 200 ); } function endpoint_form_admin_activate_prof_CIPF() { PLGNTLS_class::debug_infos(); $base_rest_route = PLGNTLS_class::BASE_REST_ROUTE; register_rest_route($base_rest_route, '/admin_prof_activate_form', array( 'methods' => 'POST', 'callback' => 'admin_validate_prof_form_CIPF', )); }; add_action('rest_api_init', 'endpoint_form_admin_activate_prof_CIPF'); /* * ABORTED * enqueue script that should prevent the form to submit, but does not work * function admin_validate_prof_prevent_CIPF() { PLGNTLS_class::debug_infos(); $handle = 'admin_prevent_submit'; $url = PLGNTLS_class::root_url() . 'js/admin_prevent_submit.js'; $dependencies = array(); $version = null; $defer = true; wp_enqueue_script($handle, $url, $dependencies, $version, $defer); } add_action('wp_enqueue_scripts', 'admin_validate_prof_prevent_CIPF'); */ ?>