Tengo un plugin en wordpress que ejecuta unos contadores:
Mi pregunta es si es posible actualizar esa variable con JQuery mediante algún evento por ejemplo al dar click en el ícono del corazón. No pretendo que me hagan el trabajo, solamente que me digan si es posible y más o menos un ejemplo de cómo hacerlo, no soy experto en PHP y menos en JQuery.
De antemano muchas gracias.
Archivo PHP:
if(isset($count_options['font-color']) && $count_options['font-color'] != ''){
$dynamic_css[] = "color: {$count_options['font-color']};";
}
if(isset($count_options['animation']['enable'])){
$data_animation = "data-enable='on'";
}else{
$data_animation = "data-enable='off'";
}
if(isset($count_options['animation']['enable'])){
if(isset( $count_options['animation']['delay'] ) && $count_options['animation']['delay'] !='' ){
$data_delay = "data-delay='{$count_options['animation']['delay']}'";
}else{
$data_delay = '';
}
if(isset( $count_options['animation']['duration'] ) && $count_options['animation']['duration'] !='' ){
$data_duration = "data-duration='{$count_options['animation']['duration']}'";
}else{
$data_duration = '';
}
}else{
$data_delay = '';
$data_duration ='';
}
if ($counter == 2) {
$count_options['content'] = $count_prayer * 3;
}
?>
<div class="ec-count-content"><span class="ec-count-number" <?php echo $data_animation; echo $data_delay; echo $data_duration; ?> ><?php echo esc_attr($count_options['content']); ?></span><?php if($template == 'template12'){ ?><span class='ec-count-sign'>+</span><?php } ?></div>
<?php
if(isset($count_options['font-family']) && $count_options['font-family'] !=''){
if(!in_array( $count_options['font-family'], $google_fonts_used_array) ){
array_push($google_fonts_used_array, preg_replace('/\s/', '+', $count_options['font-family']) );
}
$dynamic_css[] = "font-family: {$count_options['font-family']};";
}
if(!empty($dynamic_css)){
$dynamic_css = implode(' ', $dynamic_css);
}else{
$dynamic_css ='';
}
ob_start();
?>
.ec-<?php echo $template; ?> .ec-counter-item-<?php echo $counter; ?> .ec-count-content .ec-count-number { <?php echo esc_attr($dynamic_css); ?> }
<?php
$ec_dynamic_css_at_end[] = ob_get_contents();
ob_end_clean();
}