最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multisite - Four columns in the wp_users table

programmeradmin0浏览0评论

I am writing custom code to allow users of my site delete their own accounts from the front-end (i.e., they do not have to logon to the WordPress admin area to perform certain actions, but rather I created front-end pages that allow the users to do some basic operations, including deleting their own accounts).

Now, this is a multi-site network and the function to delete a user account is wpmu_delete_user($user_id). This call will completely purge the user account and remove it from the database.

When I inspected the wp_users table, I found the following columns that I think are interesting and will help me in completing the front-end actions I am trying to create. Those columns are, user_activation_key, user_status, spam, and deleted.

Now, I can use those leberally by writing directly to the database via $wpdb, but I have the following questions

  1. Are there any specific WordPress methods or functions that allow me to interact with those four columns? How does WordPress interact with those columns?

  2. What are the expected values for user_status?

  3. How can I set a user as deleted or spam via a method?

  4. If I set a user as either deleted or spamn, what is the effect on WordPress? Would that user be able to be used? Can the user make posts? Can the user comment? Can the user even log in?

  5. Why is there a deleted column. Deleting a user completely removes it from the database, so what's the purpose of this column?

Thank you.

发布评论

评论列表(0)

  1. 暂无评论