function handle_delete_events_cache() { if (!function_exists('rhc_handle_delete_events_cache')) { require_once RHC_PATH . 'includes/function.rhc_handle_delete_events_cache.php'; } rhc_handle_delete_events_cache(); }
function pop_handle_save($pop) { global $rhc_plugin; if ($rhc_plugin->options_varname != $pop->options_varname) { return; } update_option('rhc_flush_rewrite_rules', true); if (isset($_POST['btn_clear_event_color'])) { if (current_user_can($rhc_plugin->options_capability)) { global $wpdb; $sql = "DELETE FROM `{$wpdb->postmeta}` WHERE meta_key IN ('fc_color','fc_text_color');"; $wpdb->query($sql); } } if (isset($_POST['btn_wp41_empty_posts_bug'])) { if (current_user_can($rhc_plugin->options_capability)) { global $wpdb; $sql = sprintf("UPDATE `{$wpdb->posts}` SET `post_content`=' ' WHERE TRIM(post_title)='' AND TRIM(post_content)='' AND TRIM(post_excerpt)='' AND post_type='%s';", RHC_EVENTS); $wpdb->query($sql); } } add_action('admin_init', array(&$this, 'save_file_cache')); //so that insert with markers is defined. if (isset($_POST['rhc_cache_clear'])) { if (!function_exists('rhc_handle_delete_events_cache')) { require_once RHC_PATH . 'includes/function.rhc_handle_delete_events_cache.php'; } rhc_handle_delete_events_cache(); //Note: currently only saving options clears cache. but that may change. keep this just in case. } }
function handle_delete_events_cache() { global $rhc_plugin, $wpdb; if ('1' != $rhc_plugin->get_option('disable_rhc_cache', '', true)) { //clear cache. if (!function_exists('rhc_handle_delete_events_cache')) { require_once RHC_PATH . 'includes/function.rhc_handle_delete_events_cache.php'; } rhc_handle_delete_events_cache(); } }