precache working
Peter Molnar hello@petermolnar.eu
Tue, 26 Mar 2013 17:41:58 +0000
1 files changed,
6 insertions(+),
2 deletions(-)
jump to
M
wp-ffpc-class.php
→
wp-ffpc-class.php
@@ -786,10 +786,12 @@ $this->precache_list_permalinks ( $links, $blog['blog_id'] );
} } 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 .= '<?php $links = ' . var_export ( $links , true ) . ';@@ -815,6 +817,8 @@
file_put_contents ( $tmpfile, $out ); $shellfunction = $this->shell_function; $shellfunction( 'php '. $tmpfile .' >'. $this->precache_logfile .' 2>&1 &' ); + + endif; }@@ -824,10 +828,10 @@ *
*/ 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 ); }