Changeset 5930 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-committers.php
- Timestamp:
- 09/16/2017 06:23:16 AM (7 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
r4301 r5930 92 92 function add_committer( $request ) { 93 93 $user = new WP_User( $request['committer'] ); 94 if ( ! $user->exists() ) { 94 95 // If user_login is not found, try searching by user_nicename. 96 if ( ! $user || ! $user->exists() ) { 97 $user = get_user_by( 'slug', $request['committer'] ); 98 } 99 100 // If user_nicename is not found, try searching by user_email. 101 if ( ! $user || ! $user->exists() ) { 102 $user = get_user_by( 'email', $request['committer'] ); 103 } 104 105 if ( ! $user || ! $user->exists() ) { 95 106 return new WP_Error( 'plugin_user_not_found', __( 'The provided user could not be found.', 'wporg-plugins' ) ); 96 107 } … … 107 118 function revoke_committer( $request ) { 108 119 $user = new WP_User( $request['committer'] ); 109 if ( ! $user->exists() ) { 120 121 // If user_login is not found, try searching by user_nicename. 122 if ( ! $user || ! $user->exists() ) { 123 $user = get_user_by( 'slug', $request['committer'] ); 124 } 125 126 // If user_nicename is not found, try searching by user_email. 127 if ( ! $user || ! $user->exists() ) { 128 $user = get_user_by( 'email', $request['committer'] ); 129 } 130 131 if ( ! $user || ! $user->exists() ) { 110 132 return new WP_Error( 'plugin_user_not_found', __( 'The provided user could not be found.', 'wporg-plugins' ) ); 111 133 }
Note: See TracChangeset
for help on using the changeset viewer.