Changeset 12678 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-github-invite/api.php
- Timestamp:
- 06/28/2023 02:11:16 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-github-invite/api.php
r12671 r12678 83 83 84 84 /** 85 * Add an organisation member to a team. 86 * 87 * @param int|string $who The GitHub user login. 88 * @param array $team_ids The team IDs to add the user to. 89 */ 90 function add_to_team( $who, array $team_ids ) { 91 $error = new WP_Error; 92 93 foreach ( $team_ids as $team_id ) { 94 $response = api( 95 "/orgs/{ORG}/team/{$team_id}/memberships/{$who}", 96 false, 97 'PUT' 98 ); 99 100 if ( is_wp_error( $response ) ) { 101 $error->merge_from( $response ); 102 } 103 } 104 105 if ( $error->get_error_code() ) { 106 return $error; 107 } 108 109 return $response; 110 } 111 112 /** 85 113 * Cancel an invitation by ID 86 114 */ … … 92 120 ); 93 121 } 94 95 122 96 123 /**
Note: See TracChangeset
for help on using the changeset viewer.