Пример #1
0
/**
 * This invalidates our XML Sitemaps cache.
 *
 * @param string $type
 */
function wpseo_invalidate_sitemap_cache($type)
{
    // Always delete the main index sitemaps cache, as that's always invalidated by any other change
    delete_transient('wpseo_sitemap_cache_1');
    delete_transient('wpseo_sitemap_cache_' . $type);
    WPSEO_Utils::clear_sitemap_cache(array($type));
}
Пример #2
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
     $this->options['seen_about'] = false;
     // make sure user is redirected to the about screen
     update_option('wpseo', $this->options);
     // this also ensures the DB version is equal to WPSEO_VERSION
     add_action('shutdown', 'flush_rewrite_rules');
     // Just flush rewrites, always, to at least make them work after an upgrade.
     WPSEO_Utils::clear_sitemap_cache();
     // Flush the sitemap cache
     WPSEO_Options::ensure_options_exist();
     // Make sure all our options always exist - issue #1245
 }
Пример #3
0
 /**
  * Runs the needed cleanup after an update, setting the DB version to latest version, flushing caches etc.
  */
 private function finish_up()
 {
     $this->options = WPSEO_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 WPSEO_VERSION.
     add_action('shutdown', 'flush_rewrite_rules');
     // Just flush rewrites, always, to at least make them work after an upgrade.
     WPSEO_Utils::clear_sitemap_cache();
     // Flush the sitemap cache.
     WPSEO_Options::ensure_options_exist();
     // Make sure all our options always exist - issue #1245.
 }
 /**
  * Clear author sitemap cache when settings are changed
  *
  * @since 3.1
  *
  * @param int    $meta_id The ID of the meta option changed.
  * @param int    $object_id The ID of the user.
  * @param string $meta_key The key of the meta field changed.
  */
 public function clear_author_sitemap_cache($meta_id, $object_id, $meta_key)
 {
     if ('_yoast_wpseo_profile_updated' === $meta_key) {
         WPSEO_Utils::clear_sitemap_cache(array('author'));
     }
 }