Changeset 36695 for trunk/src/wp-admin/user-new.php
- Timestamp:
- 02/24/2016 09:42:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/user-new.php
r35742 r36695 69 69 if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_network_users' ) ) { 70 70 add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) ); 71 $redirect = add_query_arg( array( 'update' => 'addnoconfirmation'), 'user-new.php' );71 $redirect = add_query_arg( array( 'update' => 'addnoconfirmation' , 'user_id' => $user_id ), 'user-new.php' ); 72 72 } else { 73 73 $newuser_key = substr( md5( $user_id ), 0, 5 ); … … 148 148 if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_network_users' ) ) { 149 149 $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) ); 150 wpmu_activate_signup( $key ); 151 $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); 150 $new_user = wpmu_activate_signup( $key ); 151 if ( ! is_wp_error( $new_user ) ) { 152 $redirect = add_query_arg( array( 'update' => 'addnoconfirmation' ), 'user-new.php' ); 153 } else { 154 $redirect = add_query_arg( array( 'update' => 'addnoconfirmation', 'user_id' => $new_user['user_id'] ), 'user-new.php' ); 155 } 152 156 } else { 153 157 $redirect = add_query_arg( array('update' => 'newuserconfirmation'), 'user-new.php' ); … … 224 228 $messages = array(); 225 229 if ( is_multisite() ) { 230 $edit_link = ''; 231 if ( ( isset( $_GET['user_id'] ) ) ) { 232 $user_id_new = absint( $_GET['user_id'] ); 233 if ( $user_id_new ) { 234 $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) ); 235 } 236 } 237 226 238 switch ( $_GET['update'] ) { 227 239 case "newuserconfirmation": … … 232 244 break; 233 245 case "addnoconfirmation": 234 $messages[] = __('User has been added to your site.'); 246 if ( empty( $edit_link ) ) { 247 $messages[] = __( 'User has been added to your site.' ); 248 } else { 249 $messages[] = sprintf( __( 'User has been added to your site. <a href="%1$s">Edit User</a>' ), $edit_link ); 250 } 235 251 break; 236 252 case "addexisting":
Note: See TracChangeset
for help on using the changeset viewer.