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 ); }