mended coding char error that produced a wp-login cache token blocked

This commit is contained in:
jorge-vitrubio 2023-01-15 15:23:07 +01:00
parent 92ad836a75
commit 1695c53837
1 changed files with 34 additions and 36 deletions

View File

@ -18,9 +18,8 @@
* @package Oficina_de_Suport_theme
*/
?>
<?php
if( ! function_exists( 'ofisuport_ajuts_filters_form' ) ){
<?php
if( ! function_exists( 'ofisuport_ajuts_filters_form') ) {
function ofisuport_ajuts_filters_form() {
?>
<div id="archive-filters" class="ofisuport-filters">
@ -31,76 +30,76 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form' ) ){
?>
<?php // start the form ?>
<form id="form-ajuts" name="search-ajuts">
<?php
$groupkey_fields = acf_get_fields($groupkey);
foreach( $groupkey_fields as $field_key ) {
if( $field_key['type'] == 'checkbox' ){
// https://wordpress.stackexchange.com/a/102915
$fields = get_field_object($field_key['key']);
if( $fields ) {
// check for values from meta fields db in url
foreach( $GLOBALS['my_query_filters'] as $key => $fieldname ) {
// check for values in url and get value if available
if( isset($_GET[ $fieldname ]) ) {
$filteredvalues['value'] = explode(',', $_GET[ $fieldname ]);
};
//end check for values in url
};
//end check for values in url
// construct the checkboxes
if( $fieldname == $fields['name']) {
?>
?>
<section id="fund-filter-<?php echo $fields['name']; ?>" class="<?php echo $fields['name']; ?>">
<h5><?php echo $fields['label'];?></h5>
<?php foreach( $fields['choices'] as $choicevalue => $choicelabel ) { ?>
<div class="filter" data-filter="<?php echo $fields['name'];?>">
<input class="ofisuport-filter" type="checkbox" name="<?php echo $fields['name'];?>" <?php if( in_array($choicevalue,$filteredvalues['value']) ) { echo 'checked';}; ?> value="<?php echo $choicevalue ?>" />
<label for="<?php echo $choicevalue; ?>"><?php echo $choicelabel;?></label>
</div>
<?php };//end foreach fields['choices'] ?>
</section>
<?php }; //end if fieldname == fields['name'] ?>
<?php // end of construct checkboxes ?>
<?php }; // end check for values from meta fields db in url ?>
<?php }; //end if field_key['key'] ?>
<?php }; //end if type checkbox ?>
<?php }; //end foreach groupkey field ?>
<?php //echo '<p><span id="filterlink"></span></p>';?>
<p><a id="submitfilteredlink" name="submit-ajut" class="button button-more" href="">enviar</a> </p>
</form>
<?php //close the form and subit ?>
<?php }; //end if groupkey ?>
</div>
<script type="text/javascript">
(function($) {
// change
$('#archive-filters').on('click', 'input', function(){
// vars
// vars
var url = '<?php echo home_url('ajuts/'); ?>';
args = {};
var appendtoURL = '';
var eachfiltered = '';
var valueschecked = '';
// loop over filters
$('#archive-filters .filter').each(function(){
// check if is first appearance of each
@ -113,7 +112,7 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form' ) ){
};
// start new fieldname filtered
eachfiltered = $(this).data('filter');
// reset values
// reset values
valueschecked = '';
// find checked inputs
$(this).find('input:checked').each(function(){
@ -140,27 +139,26 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form' ) ){
valueschecked = valueschecked.slice(0, -1);
// save last cycled filtered value already calculated field=val01,val02,val03
appendtoURL += eachfiltered +'=' +valueschecked +'&';
// remove last &
appendtoURL = appendtoURL.slice(0, -1);
// update url
url += '?' +appendtoURL;
// show or modify the url
//alert( url );
//$('#filterlink').text(url);
// convert a href url to new value
$('#submitfilteredlink').attr('href',url);
});
})(jQuery);
</script>
<?php
}; //end ofisuport_ajuts_filters_form()
}; // end if ! functionexists
<?php
}; //end ofisuport_ajuts_filters_form
}; // end if ! functions_exists
?>