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
Post a Comment