Generate wordpress user password

0.94K views
no comments
14 Dec 2014 4:27 pm

Create wordpress password for your theme function or plugins.

function generate_wp_pass($text_password) {
    require_once( ABSPATH . 'wp-includes/class-phpass.php');
    //IN 3.6 OR OLDER VERSION CANNOT AUTO LOAD PASSWORD CLASS SO YOU WILL NEED TO LOAD IT MANNUALLY

    $wp_hasher = new PasswordHash(8, true);
    return $hasher->HashPassword($text_password);
}

NOTE:Your Email Address will be not shown and please do not add spamming comments because here is REL="NOFOLLOW" on your links and comments also moderated shown.
<code>Put html css or any language code under this tag</code>