public function update($new_instance, $old_instance) { hocwp_delete_transient('hocwp_top_commenters'); $instance = $old_instance; $instance['title'] = strip_tags(hocwp_get_value_by_key($new_instance, 'title')); $instance['number'] = hocwp_get_value_by_key($new_instance, 'number', hocwp_get_value_by_key($this->args, 'number')); $instance['time'] = hocwp_get_value_by_key($new_instance, 'time', hocwp_get_value_by_key($this->args, 'time')); $instance['exclude_users'] = hocwp_get_value_by_key($new_instance, 'exclude_users'); $instance['show_count'] = hocwp_checkbox_post_data_value($new_instance, 'show_count'); $instance['link_author_name'] = hocwp_checkbox_post_data_value($new_instance, 'link_author_name'); $instance['none_text'] = hocwp_get_value_by_key($new_instance, 'none_text', hocwp_get_value_by_key($this->args, 'none_text')); return $instance; }
function hocwp_comment_inserted_hook($id, $comment) { hocwp_delete_transient('hocwp_top_commenters'); }
function hocwp_delete_transient_license_valid($blog_id = '') { $transient_name = 'hocwp_check_license'; hocwp_delete_transient($transient_name, $blog_id); }
function hocwp_translate_x_string_transaltion_update() { if (isset($_REQUEST['hocwp_action']) && 'string_translation' == $_REQUEST['hocwp_action']) { unset($_REQUEST['hocwp_action']); $search = hocwp_get_method_value('s', 'request'); $strings = hocwp_get_method_value('strings'); if (hocwp_array_has_value($strings)) { $mo = new HOCWP_MO(); $saved_strings = hocwp_get_registered_string_language(); foreach ($strings as $encrypted_string) { unset($saved_strings[$encrypted_string]); $mo->delete_from_db($encrypted_string, true); } update_option('hocwp_string_translations', $saved_strings); hocwp_delete_transient('hocwp_string_translation_registered'); } $args = array_intersect_key($_REQUEST, array_flip(array('s', 'paged', 'group'))); if (!empty($search)) { $args['s'] = $search; } if (!empty($args['s'])) { $args['s'] = urlencode($args['s']); } $translations = hocwp_get_method_value('translation'); if (hocwp_array_has_value($translations)) { foreach ($translations as $key => $value) { if (!empty($value)) { $mo = hocwp_get_post_by_column('post_title', 'hocwp_mo_' . $key, OBJECT, array('post_type' => 'hocwp_mo')); if (is_a($mo, 'WP_Post')) { $obj = new HOCWP_MO($mo->ID); $obj->export_to_db($mo->post_excerpt, $value); } } } } $url = add_query_arg($args, wp_get_referer()); wp_safe_redirect($url); exit; } }
function hocwp_setup_theme_delete_post_cache() { hocwp_delete_transient('hocwp_cache_post_thumbnail'); }