wordpress - Make "Add New User" redirect to user's profile -


i'm wondering if it's possible when create new user user-new.php you're being redirect user's profile instead of users.php

i'm having custom fields show when edit user, make workflow more easy admin gets redirect user's profile can add custom fields instantly.

wp_redirect filterable, hook in redirect after user added. tested following, might need few tweaks trick:

add_filter( 'wp_redirect', 'wp_redirect_after_user_new', 1, 1 ); function wp_redirect_after_user_new( $location ) {     global $pagenow;      if( is_admin() && 'user-new.php' == $pagenow )     {         $user_details = get_user_by( 'email', $_request[ 'email' ] );         $user_id = $user_details->id;          if( $location == 'users.php?update=add&id=' . $user_id )             return add_query_arg( array( 'user_id' => $user_id ), 'user-edit.php' );     }      return $location; } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -