- Timestamp:
- 12/17/2015 11:09:09 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/core/credits/wp-credits.php
r2168 r2195 116 116 117 117 if ( false === $validators ) { 118 $validators = $this->_grab_validators( $gp_locale );118 $validators = $this->_grab_validators( $gp_locale, $path ); 119 119 $this->cache_set( $cache_key['validators'], $validators ); 120 120 } … … 176 176 } 177 177 178 private function _grab_validators( $gp_locale ) {178 private function _grab_validators( $gp_locale, $path ) { 179 179 global $wpdb; 180 $users = $this->grab_validators( $gp_locale );180 $users = $this->grab_validators( $gp_locale, $path ); 181 181 182 182 if ( ! $users ) … … 199 199 } 200 200 201 protected function grab_validators( $gp_locale ) {201 protected function grab_validators( $gp_locale, $path ) { 202 202 global $wpdb; 203 $subdomain = $wpdb->get_var( $wpdb->prepare( "SELECT subdomain FROM locales WHERE locale = %s", $gp_locale->wp_locale ) ); 204 $blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM wporg_blogs WHERE domain = %s AND path = '/'", "$subdomain.wordpress.org" ) ); 205 if ( $blog_id ) { 206 $meta_key = 'wporg_' . intval( $blog_id ) . '_capabilities'; 207 return $wpdb->get_col( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$meta_key' AND meta_value LIKE '%translation_editor%'" ); 208 } 209 return array(); 203 204 $path = 'wp/' . $path; 205 $path = like_escape( $path ) . '%'; 206 207 $project_ids = $wpdb->get_col( "SELECT `id` FROM `translate_projects` WHERE ( `path` LIKE '$path' OR `path` = 'wp' ) AND `active` = 1" ); // Project validators 208 if ( ! $project_ids ) { 209 $project_ids = array(); 210 } 211 212 $project_ids[] = '0'; // Global validators 213 214 return $wpdb->get_col( $wpdb->prepare( " 215 SELECT `user_id` FROM `translate_translation_editors` 216 WHERE `project_id` IN (" . implode( ', ', $project_ids ) . ") AND `locale` = %s 217 ", $gp_locale->slug ) ); 210 218 } 211 219
Note: See TracChangeset
for help on using the changeset viewer.