當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WPSEO_Utils::clear_sitemap_cache方法代碼示例

本文整理匯總了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));
}
開發者ID:presteege,項目名稱:presteege.fr,代碼行數:12,代碼來源:wpseo-functions.php

示例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
 }
開發者ID:goodbayscott,項目名稱:wwr-temp,代碼行數:18,代碼來源:class-upgrade.php

示例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.
 }
開發者ID:Didox,項目名稱:beminfinito,代碼行數:16,代碼來源:class-upgrade.php

示例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'));
     }
 }
開發者ID:SayenkoDesign,項目名稱:ividf,代碼行數:15,代碼來源:class-admin-user-profile.php


注:本文中的WPSEO_Utils::clear_sitemap_cache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。