guide users to design professional WordPress Theme 1 pretty good trick, How to check if User has logged in WordPress or not? When you are creating WordPress plugins, you may want to know if the WordPress user is logged in before you can proceed with other events.
Code to redirect after login WordPress admin
If you want to know how to check if the user is logged in or not, I will share with you in this post the code that you can use to check the user’s login status. In most cases, this code can be used in a WordPress theme or plugin to determine the user’s state.
Code to redirect after login WordPress admin

nstructions How to check if the user is logged in to WordPress or not?
WordPress Check If User is Logged In
The main reason why you should always check if the user is logged in when creating a WordPress theme or plugin is for security purposes.
Second, you might want to verify if the user is logged in so that you only show certain information to logged in users and not to non-logged in users.

WP Function: is_user_logged in
Insert the following code into the functione.php file in the theme you are using
function check_if_user_is_loggedin_function() { if ( is_user_logged_in() ) { // code } } add_action(‘init’, ‘check_if_user_is_loggedin_function’);
|
You can also check if the user is logged in outside the functions.php file in a custom plugin or somewhere in your theme file using the code below:
if ( is_user_logged_in() ) { echo ‘Welcome, registered user!’; } else { echo ‘Welcome, visitor!’; };
|
Link : https://chothemeweb.com/code-chuyen-huong-sau-khi-dang-nhap-admin.html