{"id":8601232,"date":"2016-12-29T19:49:24","date_gmt":"2016-12-29T19:49:24","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/remove-action-community_role_edit\/"},"modified":"2016-12-29T19:49:24","modified_gmt":"2016-12-29T19:49:24","slug":"remove-action-community_role_edit","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/remove-action-community_role_edit\/","title":{"rendered":"Remove action &#8220;community_role_edit&#8221;"},"content":{"rendered":"<p>Hi,<\/p>\n<p>As I don&#8217;t want that my custom role &#8220;Webmaster&#8221; can change the &#8220;user community role&#8221; during the process of editing a user, I&#8217;d like to remove the action &#8220;community_role_edit&#8221; that you call in &#8220;\/core\/um-user.php&#8221;. BTW I&#8217;ll can remove properly the list of role that you add at the bottom of &#8220;user-edit.php&#8221;.<br \/>\nSo, I tried :<\/p>\n<pre><code>function remove_action_from_UM() {\n\tif ( !current_user_can( &#039;manage_options&#039; ))\n\t\tremove_action(&#039;edit_user_profile&#039;, &#039;community_role_edit&#039;);\n}\nadd_action(&#039;edit_user_profile&#039;, &#039;remove_action_from_UM&#039;, 9999);<\/code><\/pre>\n<p>But with no success :(.<\/p>\n<p>Could you help me please?<\/p>\n<p>TIA.<\/p>\n<p>Amicably,<\/p>\n<p>Pierre.<\/p>\n","protected":false},"template":"","class_list":["post-8601232","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8601232","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\/8601232\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=8601232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}