Skip to content

Commit a59408d

Browse files
committed
clear inbox cache after update
1 parent 24c5349 commit a59408d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

includes/class-migration.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ public static function maybe_migrate() {
114114
if ( version_compare( $version_from_db, '1.0.0', '<' ) ) {
115115
self::migrate_from_0_17();
116116
}
117+
if ( version_compare( $version_from_db, '1.3.0', '<' ) ) {
118+
self::migrate_from_1_2_0();
119+
}
117120

118121
update_option( 'activitypub_db_version', self::get_target_version() );
119122

@@ -176,4 +179,22 @@ private static function migrate_from_0_16() {
176179
\update_option( 'activitypub_custom_post_content', $content );
177180
}
178181
}
182+
183+
/**
184+
* Clear the cache after updating to 1.3.0
185+
*
186+
* @return void
187+
*/
188+
private static function migrate_from_1_2_0() {
189+
$user_ids = get_users(
190+
array(
191+
'fields' => 'ID',
192+
'capability__in' => array( 'publish_posts' ),
193+
)
194+
);
195+
196+
foreach ( $user_ids as $user_id ) {
197+
wp_cache_delete( sprintf( Followers::CACHE_KEY_INBOXES, $user_id ), 'activitypub' );
198+
}
199+
}
179200
}

0 commit comments

Comments
 (0)