WordPress 修改用户ID

将下面的代码添加到当前主题函数模板 functions.php 中:

  1. global $wpdb;
  2. $wpdb->query("UPDATE wp_users SET ID = 1 WHERE ID = 2");
  3. $wpdb->query("UPDATE wp_usermeta SET user_id = 1 WHERE user_id = 2");
  4. $wpdb->query("UPDATE wp_posts SET post_author = 1 WHERE post_author = 2");
  5. $wpdb->query("UPDATE wp_comments SE...

标签: wordpress

lijiayan 发布于  2021-7-29 23:05