I would like to generate a unique password hash and try to use the following wordpress function:
$activation_token = wp_generate_password();
update_user_meta($user_id, 'activation_token', $activation_token);
Unfortunately, it not work because Fatal error: Uncaught Error: Call to undefined function wp_generate_password()
Is this function deprecated? I cannot find anything else in WordPress documentation.
Edit: I try the code in my wordpress theme and in works! So the problem is, i cannot call any wordpress core functions? I have the same problem with wp_mail()
I updated the wordpress installation, use the default Twenty theme and deactivated all other plugins but i have still the same probelm! wp_ functions not work in plugin, why?