本文整理汇总了PHP中FLBuilderModel::delete_asset_cache_for_all_posts方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::delete_asset_cache_for_all_posts方法的具体用法?PHP FLBuilderModel::delete_asset_cache_for_all_posts怎么用?PHP FLBuilderModel::delete_asset_cache_for_all_posts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::delete_asset_cache_for_all_posts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Runs the update for a specific version.
*
* @since 1.2.8
* @access private
* @return void
*/
private static function run($saved_version)
{
// Update to 1.2.8 or greater.
if (version_compare($saved_version, '1.2.8', '<')) {
self::v_1_2_8();
}
// Update to 1.4.6 or greater.
if (version_compare($saved_version, '1.4.6', '<')) {
self::v_1_4_6();
}
// Update to 1.6.3 or greater.
if (version_compare($saved_version, '1.6.3', '<')) {
self::v_1_6_3();
}
// Clear all asset cache.
FLBuilderModel::delete_asset_cache_for_all_posts();
}
示例2: clear_cache_for_all_sites
/**
* Clears the builder cache for all sites on a network.
*
* @since 1.5.3
* @access private
* @return void
*/
private static function clear_cache_for_all_sites()
{
global $blog_id;
global $wpdb;
// Save the original blog id.
$original_blog_id = $blog_id;
// Get all blog ids.
$blog_ids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
// Loop through the blog ids and clear the cache.
foreach ($blog_ids as $id) {
switch_to_blog($id);
FLBuilderModel::delete_asset_cache_for_all_posts();
}
// Revert to the original blog.
switch_to_blog($original_blog_id);
}