将Wordpress管理用户添加到数据库
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将Wordpress管理用户添加到数据库相关的知识,希望对你有一定的参考价值。
When working on client sites, you often need admin access, instead of requiring them to set up an admin user, just make your own. ref:http://www.dnawebagency.com/how-to-add-an-admin-user-to-the-wordpress-database
-- Step 1 Add the user -- Change db_wordpress to DB name -- Change wp_ to your table prefix -- Change username, pass, nicename, email, url, displayname and pass to your new user info -- Change date to whenever you want the registered date to be INSERT INTO `db_wordpress`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (NULL, 'username', MD5('pass'), 'nicename', 'email', 'url', '2010-10-08 00:00:00', '', '0', 'displayname'); -- Step 2 Add permissions -- Find the userid that was just created (int) -- Replace id with the user id -- Done
以上是关于将Wordpress管理用户添加到数据库的主要内容,如果未能解决你的问题,请参考以下文章
用户角色 - 添加角色功能 php 片段 - Wordpress
如何将 WordPress 用户角色添加到 Woocommerce 新管理员订单电子邮件主题
php Wordpress functions.php片段使用Yoast的插件将Google Analytics跟踪添加到wp_nav_menu