示例#1
0
 /**
  * Runs the needed cleanup after an update, setting the DB version to latest version, flushing caches etc.
  */
 private function finish_up()
 {
     $this->options = get_option('wpseo');
     // Re-get to make sure we have the latest version.
     update_option('wpseo', $this->options);
     // This also ensures the DB version is equal to YMBESEO_VERSION.
     add_action('shutdown', 'flush_rewrite_rules');
     // Just flush rewrites, always, to at least make them work after an upgrade.
     YMBESEO_Utils::clear_sitemap_cache();
     // Flush the sitemap cache.
     YMBESEO_Options::ensure_options_exist();
     // Make sure all our options always exist - issue #1245.
 }
示例#2
0
/**
 * This invalidates our XML Sitemaps cache.
 *
 * @param string $type
 */
function YMBESEO_invalidate_sitemap_cache($type)
{
    // Always delete the main index sitemaps cache, as that's always invalidated by any other change.
    delete_transient('YMBESEO_sitemap_cache_1');
    delete_transient('YMBESEO_sitemap_cache_' . $type);
    YMBESEO_Utils::clear_sitemap_cache(array($type));
}