{"id":2840,"date":"2014-02-23T08:27:31","date_gmt":"2014-02-23T08:27:31","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/23\/undefined-function-wp_set_password-collection-of-common-programming-errors\/"},"modified":"2014-02-23T08:27:31","modified_gmt":"2014-02-23T08:27:31","slug":"undefined-function-wp_set_password-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/02\/23\/undefined-function-wp_set_password-collection-of-common-programming-errors\/","title":{"rendered":"Undefined function wp_set_password-Collection of common programming errors"},"content":{"rendered":"<p>When your plugin loads, pluggable functions aren&#8217;t loaded yet, in fact a lot of stuff is not loaded yet, this what actions are for. Hook your function to an action, like <code>plugins_loaded<\/code> or <code>init<\/code>, when the WP environment is loaded and initialized:<\/p>\n<pre><code>add_action( 'init', 'wpa80246_init' );\n\nfunction wpa80246_init(){\n    wp_set_password( 'newpass', $user_id );\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When your plugin loads, pluggable functions aren&#8217;t loaded yet, in fact a lot of stuff is not loaded yet, this what actions are for. Hook your function to an action, like plugins_loaded or init, when the WP environment is loaded and initialized: add_action( &#8216;init&#8217;, &#8216;wpa80246_init&#8217; ); function wpa80246_init(){ wp_set_password( &#8216;newpass&#8217;, $user_id ); }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2840","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2840"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2840\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}