大家好!
我通过使用相同的hook add\\u操作(“delete\\u user”、“my\\u delete\\u user”)解决了此问题;
这是我的密码
<?php
function my_delete_user( $user_id ) {
global $wpdb;
$user_obj = get_userdata( $user_id );
$id_user = $user_obj->ID;
$idsss = $user_obj->user_id;
/*Delete Data from friend table*/
$query_friend= $wpdb->query("DELETE FROM `wp_user_friends` where `friend_id` = ".$user_obj->ID."");
/*delete data from group*/
$delete_group_table =$wpdb->query("DELETE FROM `wp_group` where `user_id` = ".$user_obj->ID."");
}
add_action( \'delete_user\', \'my_delete_user\' );
?>
现在它工作得很好。