File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments