precache working
This commit is contained in:
parent
1a726f01eb
commit
b5cde93bee
1 changed files with 6 additions and 2 deletions
|
@ -786,11 +786,13 @@ if ( ! class_exists( 'WP_FFPC' ) ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$links = $this->precache_list_permalinks ( $links, false );
|
$this->precache_list_permalinks ( $links, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmpfile = tempnam(sys_get_temp_dir(), 'wp-ffpc');
|
$tmpfile = tempnam(sys_get_temp_dir(), 'wp-ffpc');
|
||||||
|
|
||||||
|
if ( !empty ( $links ) ) :
|
||||||
|
|
||||||
$out .= '<?php
|
$out .= '<?php
|
||||||
$links = ' . var_export ( $links , true ) . ';
|
$links = ' . var_export ( $links , true ) . ';
|
||||||
|
|
||||||
|
@ -815,6 +817,8 @@ if ( ! class_exists( 'WP_FFPC' ) ) {
|
||||||
file_put_contents ( $tmpfile, $out );
|
file_put_contents ( $tmpfile, $out );
|
||||||
$shellfunction = $this->shell_function;
|
$shellfunction = $this->shell_function;
|
||||||
$shellfunction( 'php '. $tmpfile .' >'. $this->precache_logfile .' 2>&1 &' );
|
$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 ) {
|
private function precache_list_permalinks ( &$links, $site = false ) {
|
||||||
global $post;
|
global $post;
|
||||||
$current_blog = get_current_blog_id();
|
|
||||||
include_once ( ABSPATH . "wp-load.php" );
|
include_once ( ABSPATH . "wp-load.php" );
|
||||||
|
|
||||||
if ( $site !== false ) {
|
if ( $site !== false ) {
|
||||||
|
$current_blog = get_current_blog_id();
|
||||||
switch_to_blog( $site );
|
switch_to_blog( $site );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue