Changeset 5930
- Timestamp:
- 09/16/2017 06:23:16 AM (7 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes
- Files:
-
- 2 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 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-support-reps.php
r5867 r5930 92 92 function add_support_rep( $request ) { 93 93 $user = new WP_User( $request['support_rep'] ); 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['support_rep'] ); 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['support_rep'] ); 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 remove_support_rep( $request ) { 108 119 $user = new WP_User( $request['support_rep'] ); 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['support_rep'] ); 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['support_rep'] ); 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.