Multisite flush page cache on another blog
-
Hi there,
I have a multisite installation and I am trying to access the other blogs (3 others) to flush the page cache and it doesn’t seem to be working.
I have the following code below (not my actual code but the idea of what I am trying to do)…
global $wpdb; $current_blog_id = get_current_blog_id(); $blogs = $wpdb->get_col("Select blog_id From {$wpdb->blogs}"); foreach($blogs as $blog_id) { if($current_blog_id != $blog_id) switch_to_blog($blog_id); $front_page = get_option("page_on_front"); $result = w3tc_pgcache_flush_post($front_page); var_dump($result); // displays bool(true) if($current_blog_id != $blog_id) restore_current_blog(); }
Would someone be able to shed some light please as to what I might be doing wrong?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Multisite flush page cache on another blog’ is closed to new replies.