Hello I am new to Wordpress and PHP and I am trying to delete an user in a function in a plugin.
$user = get_user_by( 'id', $user_id );
$user_patronage = Patreon_Wordpress::getUserPatronage();
if($user_patronage == false) {
wp_delete_user( $user->ID );
wp_redirect( wp_login_url().'?patreon-msg=login_with_patreon', '301' );
}
Everything is working well but when I try to use wp_delete_user i get the following error:
Call to undefined function wp_delete_user() in /homepages/6/d480314532/htdocs/wsb7416187601/zisteau_web/wp-content/plugins/patreon-wordpress-master/classes/patreon_wordpress.php on line 135
This function is located in wp-includes/user.php. Are there any way to import this funtionality to use it there?
Thanks.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire