Changeset 8385
- Timestamp:
- 03/01/2019 09:52:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php
r7050 r8385 511 511 */ 512 512 public function update_wporg_profile_badge( $user ) { 513 global $wpdb; 514 513 515 $action = 'translation_editor_added' === current_filter() ? 'add' : 'remove'; 516 517 // Remove badge only when all roles have been removed. 518 if ( 'remove' === $action ) { 519 $count = (int) $wpdb->get_var( 520 $wpdb->prepare( 521 "SELECT COUNT(*) FROM {$wpdb->wporg_translation_editors} 522 WHERE `user_id` = %d AND `locale` != 'all-locales'", 523 $user->ID 524 ) 525 ); 526 527 if ( 0 !== $count ) { 528 return; 529 } 530 } 514 531 515 532 $this->notify_profiles_wporg_translation_editor_update( $user->ID, $action );
Note: See TracChangeset
for help on using the changeset viewer.