• Resolved RonaldS

    (@norus)


    How can I solve this error caused by a new plugin.

    Fatal error: Call to undefined function wp_generate_password()

    the function is part of the wp core file wp-includes\pluggable.php
    So new plugin does not know that the function exist.
    How can I declare this function within the new plugin?

Viewing 5 replies - 1 through 5 (of 5 total)
  • You’d need to edit the plugin functions probably, but more details on the plugin itself would help – is it provided by wordpress.org, or versioned elsewhere by yourself ?

    Thread Starter RonaldS

    (@norus)

    Simple question: how does WP knows that function wp_generate_password is loaded.
    I see that this happens often in the past.

    Plugin is developed by us.
    if(isset($_GET[‘mm_confirm’])) {
    $invite = $GLOBALS[‘wpdb’]->get_row(“SELECT * FROM wp_users_invitations WHERE hash = ‘”.addslashes(trim($_GET[‘mm_confirm’])).”‘”);
    if($invite) {
    $random_password = wp_generate_password( $length = 6, $include_standard_special_chars=false, $extra_special_chars = false);
    $user_id = wp_create_user( $invite->email, $random_password, $invite->email );
    if(!is_int($user_id)) {
    if($error_codes = $user_id->get_error_codes()) {
    foreach($error_codes as $error_code) {
    if($error_messages = $user_id->get_error_messages($error_code)) {
    foreach($error_messages as $error_message) {
    echo $error_message.”;
    }
    }
    }
    }
    }

    Moderator t-p

    (@t-p)

    what is the name of the plugin in question?
    where did you download it from?

    Thread Starter RonaldS

    (@norus)

    As I wrote: Plugin is developed by us.
    But that is not the question.

    How is it possible that a default function is not loaded and how can I solve this?

    Thread Starter RonaldS

    (@norus)

    Will have to figure it out for myself.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_generate_password() is undefined in a plugin’ is closed to new replies.