ID; $cumulative_total = 0; foreach ($cached_counters as $network => $shares) { if ($network == 'total') { continue; } if (count($fake_networks) > 0 && !in_array($network, $fake_networks)) { $shares = $cached_counters[$network]; $cumulative_total += intval($shares); continue; } $shares = $cached_counters[$network]; $minimal_fake_shares = isset($minimal_fake['minimal_'.$network]) ? $minimal_fake['minimal_'.$network] : '0'; if (intval($shares) < intval($minimal_fake_shares)) { $shares = $minimal_fake_shares; } $cached_counters[$network] = $shares; $cumulative_total += intval($shares); } $cached_counters['total'] = $cumulative_total; return $cached_counters; } add_filter('essb4_get_cached_counters', 'essb_apply_minimal_counter_values'); }