Changeset 7876 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-committers.php
- Timestamp:
- 11/20/2018 07:03:45 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-committers.php
r7420 r7876 140 140 $plugin_slug = $request['plugin_slug']; 141 141 142 // Prevent a committer removing themselves, if they're the only committer. 143 if ( $user->user_login == wp_get_current_user()->user_login ) { 144 $committers = Tools::get_plugin_committers( $plugin_slug ); 145 if ( count( $committers ) == 1 && in_array( $user->user_login, $committers ) ) { 146 return new WP_Error( 'failed', __( 'Sorry, you must have at least one committer.', 'wporg-plugins' ) ); 147 } 148 } 149 142 150 $result = Tools::revoke_plugin_committer( $plugin_slug, $user ); 143 151 if ( ! $result ) {
Note: See TracChangeset
for help on using the changeset viewer.