本文整理汇总了PHP中WPSEO_Utils::clear_sitemap_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP WPSEO_Utils::clear_sitemap_cache方法的具体用法?PHP WPSEO_Utils::clear_sitemap_cache怎么用?PHP WPSEO_Utils::clear_sitemap_cache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPSEO_Utils
的用法示例。
在下文中一共展示了WPSEO_Utils::clear_sitemap_cache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpseo_invalidate_sitemap_cache
/**
* 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: finish_up
/**
* 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: finish_up
/**
* 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.
}
示例4: clear_author_sitemap_cache
/**
* 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'));
}
}