From b5cde93bee6465008f5b9636673b804a6f2d6b5e Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Tue, 26 Mar 2013 17:41:58 +0000 Subject: [PATCH] precache working --- wp-ffpc-class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-ffpc-class.php b/wp-ffpc-class.php index 0fc4884..85d2dfd 100644 --- a/wp-ffpc-class.php +++ b/wp-ffpc-class.php @@ -786,11 +786,13 @@ if ( ! class_exists( 'WP_FFPC' ) ) { } } else { - $links = $this->precache_list_permalinks ( $links, false ); + $this->precache_list_permalinks ( $links, false ); } $tmpfile = tempnam(sys_get_temp_dir(), 'wp-ffpc'); + if ( !empty ( $links ) ) : + $out .= 'shell_function; $shellfunction( 'php '. $tmpfile .' >'. $this->precache_logfile .' 2>&1 &' ); + + endif; } @@ -824,10 +828,10 @@ if ( ! class_exists( 'WP_FFPC' ) ) { */ private function precache_list_permalinks ( &$links, $site = false ) { global $post; - $current_blog = get_current_blog_id(); include_once ( ABSPATH . "wp-load.php" ); if ( $site !== false ) { + $current_blog = get_current_blog_id(); switch_to_blog( $site ); }