{"id":16194260,"date":"2022-11-13T21:01:48","date_gmt":"2022-11-13T21:01:48","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/fix-for-deprecated-create_function\/"},"modified":"2022-11-13T21:01:48","modified_gmt":"2022-11-13T21:01:48","slug":"fix-for-deprecated-create_function","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/fix-for-deprecated-create_function\/","title":{"rendered":"Fix for deprecated create_function()"},"content":{"rendered":"<p>As shown in https:\/\/github.com\/wp-crm\/wp-crm\/pull\/187<br \/>\nthe solution is to change lines #316 &amp; #317 (under track_detailed_user_activity) to <\/p>\n<pre><code>add_action(&#039;password_reset&#039;, function ($user) { WP_CRM_F::insert_event([&quot;object_id&quot; =&gt; $user-&gt;ID, &quot;attribute&quot; =&gt; &quot;detailed_log&quot;, &quot;other&quot; =&gt; 5, &quot;action&quot; =&gt; &quot;password_reset&quot;]); });\nadd_action(&#039;wp_login&#039;, function ($user_login) { $user = get_user_by(&quot;login&quot;, $user_login); WP_CRM_F::insert_event([&quot;object_id&quot; =&gt; $user-&gt;ID, &quot;attribute&quot; =&gt; &quot;detailed_log&quot;, &quot;other&quot; =&gt; 2, &quot;action&quot; =&gt; &quot;login&quot;]); });<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-16194260","topic","type-topic","status-publish","hentry","topic-tag-create_function"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16194260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16194260\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16194260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}