PluginProbe
ElasticPress / 5.3.5
ElasticPress v5.3.5
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
← All changes | includes/classes/SyncManager.php +5 -1 5.0.05.3.5 View file →
@@ -42,9 +42,9 @@
42 42
43 43 if ( defined( 'EP_SYNC_CHUNK_LIMIT' ) && is_numeric( EP_SYNC_CHUNK_LIMIT ) ) {
44 44 /**
45 45 * We also sync when we exceed Chunk limit set.
46 - * This is sometimes useful when posts are generated programatically.
46 + * This is sometimes useful when posts are generated programmatically.
47 47 */
48 48 add_action( 'ep_after_add_to_queue', [ $this, 'index_sync_on_chunk_limit' ] );
49 49 }
50 50 /**
@@ -204,8 +204,12 @@
204 204 }
205 205
206 206 $current_blog_id = get_current_blog_id();
207 207 foreach ( $this->sync_queue as $blog_id => $sync_queue ) {
208 + if ( empty( $sync_queue ) ) {
209 + continue;
210 + }
211 +
208 212 if ( $current_blog_id !== $blog_id ) {
209 213 switch_to_blog( $blog_id );
210 214 }
211 215