admin管理员组

文章数量:1305459

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.

本文标签: multisiteFour columns in the wpusers table