Changeset 12994
- Timestamp:
- 12/01/2023 03:52:47 PM (2 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
- Files:
-
- 2 edited
-
helpers/helper-other-locales.php (modified) (1 diff)
-
includes/class-wporg-notifications.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-other-locales.php
r12960 r12994 47 47 'gl' => array( 'es', 'pt', 'pt-ao', 'pt-br', 'ca', 'it', 'fr', 'ro' ), 48 48 'it' => array( 'ca', 'de', 'es', 'fr', 'pt', 'ro' ), 49 'ne' => array( 'hi', 'mr', 'as' ), 49 50 'oci' => array( 'ca', 'fr', 'it', 'es', 'gl' ), 50 51 'ug' => array( 'tr', 'uz', 'az', 'zh-cn', 'zh-tw' ), -
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-wporg-notifications.php
r12424 r12994 339 339 340 340 $project = self::get_project_from_original_id( $original_id ); 341 if ( ! $project ) { 342 return array(); 343 } 341 344 // todo: remove the deleted users in the SQL query. 342 345 $translation_editors = $wpdb->get_results( … … 378 381 $email_addresses = array(); 379 382 $project = GP_Notifications::get_project_from_original_id( $original_id ); 383 if ( ! $project ) { 384 return array(); 385 } 380 386 if ( 'wp-themes' === substr( $project->path, 0, 9 ) ) { 381 387 $author = $wpdb->get_row( … … 510 516 * @param int $original_id The id of the original string used for the discussion. 511 517 * 512 * @return GP_Project The project the original_id belongs to.513 */ 514 public static function get_project_from_original_id( int $original_id ) : GP_Project{518 * @return false|GP_Project The project the original_id belongs to. 519 */ 520 public static function get_project_from_original_id( int $original_id ) { 515 521 $original = GP::$original->get( $original_id ); 522 if ( ! $original ) { 523 return false; 524 } 516 525 $project_id = $original->project_id; 517 526 $project = GP::$project->get( $project_id ); 527 528 if ( ! $project ) { 529 return false; 530 } 518 531 $main_projects = self::get_main_projects(); 519 532 … … 694 707 public static function is_an_special_user_in_a_special_project( int $original_id, WP_User $user ):bool { 695 708 $project = self::get_project_from_original_id( $original_id ); 709 if ( ! $project ) { 710 return false; 711 } 696 712 if ( 'wp-themes' !== substr( $project->path, 0, 9 ) && ( 'wp-plugins' !== substr( $project->path, 0, 10 ) ) ) { 697 713 if ( empty( self::$i18n_email ) || empty( array_intersect( array( $user->user_email ), self::$i18n_email ) ) ) {
Note: See TracChangeset
for help on using the changeset viewer.