In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you how the WordPress one-click switch to other user identity login function is, the content is concise and easy to understand, can definitely make your eyes bright, through the detailed introduction of this article, I hope you can get something.
Today, while reading the official account, the editor found that some people reported that they could not be VIP, but the editor himself logged in to check that everything was normal and could not explain it clearly. What should I do? So ask him for the account password and log in to have a look. But asking users for account passwords every time is somewhat troublesome and unintelligent, and it also makes people feel troublesome and distasteful. So, putting the following code into functions.php allows administrators to quickly log in to other users' accounts.
Today, we use pure code to solve this problem and display it in Chinese.
/ * * WordPress backend administrator switches other account login * / function wpdx_user_switch_action ($actions, $user) {$capability = (is_multisite ())? 'manage_site':'manage_options'; if (current_user_can ($capability)) {$actions [' login_as'] ='ID ", 'bulk-users').'" > login under this identity;} return $actions } add_filter ('user_row_actions',' wpdx_user_switch_action', 10, 2); function wpdx_handle_user_switch_action ($sendback, $action, $user_ids) {if ($action = = 'login_as') {wp_set_auth_cookie ($user_ids, true); wp_set_current_user ($user_ids);} return admin_url () } add_filter ('handle_bulk_actions-users','wpdx_handle_user_switch_action', 10,3)
Refresh the WordPress background, enter the user management, you will find that there is a "login as this" button, click to automatically exit the administrator account, and password-free login with this account.
How's it going? Is it convenient to test!
The above content is how to switch to other user identity login function with one click of WordPress. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.