Changeset 12779 for trunk/src/bp-core/admin/bp-core-admin-tools.php
- Timestamp:
- 11/11/2020 01:33:08 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-tools.php
r12758 r12779 144 144 'bp_admin_repair_blog_records', 145 145 ); 146 147 if ( bp_is_active( 'blogs', 'site-icon' ) ) { 148 $repair_list[91] = array( 149 'bp-blog-site-icons', 150 __( 'Repair site tracking site icons/blog avatars synchronization.', 'buddypress' ), 151 'bp_admin_repair_blog_site_icons', 152 ); 153 } 146 154 } 147 155 … … 311 319 // All done! 312 320 return array( 0, sprintf( $statement, $result ) ); 321 } 322 323 /** 324 * Repair site icons/blog avatars synchronization. 325 * 326 * @since 7.0.0 327 * 328 * @return array 329 */ 330 function bp_admin_repair_blog_site_icons() { 331 332 /* translators: %s: the result of the action performed by the repair tool */ 333 $statement = __( 'Repairing site icons/blog avatars synchronization… %s', 'buddypress' ); 334 335 // Run function if blogs component is active. 336 if ( bp_is_active( 'blogs', 'site-icon' ) ) { 337 $blog_ids = get_sites( 338 array( 339 'fields' => 'ids', 340 'archived' => 0, 341 'mature' => 0, 342 'spam' => 0, 343 'deleted' => 0, 344 ) 345 ); 346 347 $sizes = array( 348 array( 349 'key' => 'site_icon_url_full', 350 'size' => bp_core_avatar_full_width(), 351 ), 352 array( 353 'key' => 'site_icon_url_thumb', 354 'size' => bp_core_avatar_thumb_width(), 355 ), 356 ); 357 358 foreach ( $blog_ids as $blog_id ) { 359 $site_icon = 0; 360 361 foreach ( $sizes as $size ) { 362 $site_icon = bp_blogs_get_site_icon_url( $blog_id, $size['size'] ); 363 if ( ! $site_icon ) { 364 $site_icon = 0; 365 } 366 367 bp_blogs_update_blogmeta( $blog_id, $size['key'], $site_icon ); 368 } 369 } 370 } 371 372 // All done! 373 return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) ); 313 374 } 314 375
Note: See TracChangeset
for help on using the changeset viewer.