From 66340ac819731f9c127b3b17e5d4bafb290c0c72 Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Thu, 12 Jan 2023 08:59:33 +0100 Subject: [PATCH] custom post ajuts added filter for $_GET and function for filter form --- ...m-field-ajuts-filter-function-frontend.php | 185 ++++++++++++++++++ includes/custom-field-ajuts-filter.php | 9 + ofisuport-wp-plugin.php | 1 + 3 files changed, 195 insertions(+) create mode 100644 includes/custom-field-ajuts-filter-function-frontend.php diff --git a/includes/custom-field-ajuts-filter-function-frontend.php b/includes/custom-field-ajuts-filter-function-frontend.php new file mode 100644 index 0000000..97460ee --- /dev/null +++ b/includes/custom-field-ajuts-filter-function-frontend.php @@ -0,0 +1,185 @@ + + + +
+ + +
+ + $fieldname ) { + + // check for values in url and get value if available + if( isset($_GET[ $fieldname ]) ) { + + $filteredvalues['value'] = explode(',', $_GET[ $fieldname ]); + //$filteredvalues['value'] = ($_GET[ $fieldname ]); + }; + //end check for values in url + + // construct the checkboxes + if( $fieldname == $fields['name']) { +?> + +
+
+ $choicelabel ) { ?> + +
+ + value="" + name="" /> + +
+ + + +
+ + + + + + + + + + + +

Results:

+ +
+ + + + +
+ + + + diff --git a/includes/custom-field-ajuts-filter.php b/includes/custom-field-ajuts-filter.php index db775e1..fb1d939 100644 --- a/includes/custom-field-ajuts-filter.php +++ b/includes/custom-field-ajuts-filter.php @@ -1,6 +1,15 @@