diff --git a/includes/forms.php b/includes/forms.php index 3160e3f..35922f1 100644 --- a/includes/forms.php +++ b/includes/forms.php @@ -14,3 +14,21 @@ require_once(__DIR__ . '/forms/field-ClassicRating.php'); // ## Form hooks require_once(__DIR__ . '/forms/form-satisfaction.php'); + + +// Limit countries for the paper publication order form + +add_filter('gform_pre_render_18', 'homegrade_paper_publications_form_limit_countries'); +add_filter('gform_pre_validation_18', 'homegrade_paper_publications_form_limit_countries'); +add_filter('gform_pre_submission_filter_18', 'homegrade_paper_publications_form_limit_countries'); +add_filter('gform_admin_pre_render_18', 'homegrade_paper_publications_form_limit_countries'); + +function homegrade_paper_publications_form_limit_countries($form) +{ + + add_filter('gform_countries', function ($countries) { + return array(__("Belgique", "homegrade_theme--texte-fonctionnel")); + }); + + return $form; +}