public function action_handler() { $current_action = current_filter(); foreach ($this->valid_caches as $cache_name => $clear_actions) { foreach ($clear_actions['clear_actions'] as $clear_action) { if ($current_action == $clear_action) { $cache = new WPML_WP_Cache($cache_name); $cache->flush_group_cache(); } } } }
/** * @param string $lang_code */ public function clear_string_filter($lang_code) { unset($this->string_filters[$lang_code]); $display_cache = new WPML_WP_Cache('wpml_display_filter'); $display_cache->flush_group_cache(); }
public function flush_cache() { $this->languages_details = null; $this->element_translations = null; $this->wpml_cache->flush_group_cache(); }
private function clear_ls_languages_cache() { $cache = new WPML_WP_Cache('ls_languages'); $cache->flush_group_cache(); }
function clear_elements_cache($ids, $taxonomy) { $cache = new WPML_WP_Cache(WPML_ELEMENT_TRANSLATIONS_CACHE_GROUP); $cache->flush_group_cache(); }
/** * Create new instance of WPML_WP_Cache for each group and flush cache for group. * @param array $groups */ private function flush_object_cache_for_groups($groups = array()) { if (!empty($groups)) { foreach ($groups as $group) { $cache = new WPML_WP_Cache($group); $cache->flush_group_cache(); } } }
public function update_acf_field_group() { if ($this->is_updating_acf_group()) { $cache = new WPML_WP_Cache($this->cache_group); $cache->flush_group_cache(); $this->reg_ext_patterns = array(); $group_id = $_POST['post_ID']; $groups = $this->get_acf_groups(); /** @var WP_Post $group */ foreach ($groups as $group) { if ((int) $group_id === $group->ID) { $fields = acf_get_fields($group->ID); if (is_array($fields)) { $this->update_custom_fields_settings($fields); } } } $this->update_post_meta_settings(); } }