@@ -109,10 +109,8 @@ function purgePost( $_ID )
109
109
$ this ->log ( "Function purgePost BEGIN === " );
110
110
111
111
if ( $ rt_wp_nginx_helper ->options ['purge_homepage_on_edit ' ] == 1 ) {
112
- $ homepage_url = trailingslashit ( home_url () );
113
-
114
112
$ this ->log ( "Purging homepage ' $ homepage_url' " );
115
- $ this ->purgeUrl ( $ homepage_url );
113
+ $ this ->_purge_homepage ( );
116
114
}
117
115
118
116
@@ -329,10 +327,18 @@ function purge_on_post_moved_to_trash( $new_status, $old_status, $post )
329
327
330
328
private function _purge_homepage ()
331
329
{
330
+ // WPML installetd?
331
+ if ( function_exists ('icl_get_home_url ' ) )
332
+ {
333
+ $ homepage_url = trailingslashit ( icl_get_home_url () );
334
+ $ this ->log ( sprintf ( __ ( "Purging homepage (WPML) '%s' " , "nginx-helper " ), $ homepage_url ) );
335
+ }
336
+ else
337
+ {
338
+ $ homepage_url = trailingslashit ( home_url () );
339
+ $ this ->log ( sprintf ( __ ( "Purging homepage '%s' " , "nginx-helper " ), $ homepage_url ) );
340
+ }
332
341
333
- $ homepage_url = trailingslashit ( home_url () );
334
-
335
- $ this ->log ( sprintf ( __ ( "Purging homepage '%s' " , "nginx-helper " ), $ homepage_url ) );
336
342
$ this ->purgeUrl ( $ homepage_url );
337
343
338
344
return true ;
@@ -661,11 +667,12 @@ function purge_on_check_ajax_referer( $action, $result )
661
667
function true_purge_all ()
662
668
{
663
669
global $ rt_wp_nginx_helper ;
670
+ $ prefix = substr ($ rt_wp_nginx_helper ->options ['redis_prefix ' ],0 , -1 );
664
671
$ this ->log ( "* * * * * " );
665
672
$ this ->log ( "* Purged Everything! " );
666
673
$ this ->log ( "* * * * * " );
667
674
//delete_multi_keys("*");
668
- delete_keys_by_wildcard ("* " );
675
+ delete_keys_by_wildcard ($ prefix . "* " );
669
676
}
670
677
671
678
function purge_urls ()
0 commit comments