I am looking for a filter to edit html of user-edit.php
just before it is echoed. To be more specific, I need to disable selecting multiple roles in Other Roles
. But this filter would be very handy for other stuff too. And for other admin pages as well.
-
there is no "Other Roles" in WordPress. it's certainly a plugin which add this. have you the extension "User Role Editor" e.g.– mmmCommented Oct 10, 2017 at 16:48
-
Sorry. I didn't know it's added by that plugin. I am using that exact plugin. But the question remains the same. How can i edit the HTML in admin.– Juraj.LorincCommented Oct 10, 2017 at 17:23
Add a comment
|
1 Answer
instead of editing the complet content, it's quicker to find the hook to remove
e.g. for the "other role" menu, you can use that :
add_action("wp_loaded", function () {
remove_all_actions("edit_user_profile");
});
-
This is not exactly what i was looking for. I don't want to remove it completely. I just want to disable the multi select of it and probably just make it standard drop down (
<select><option>
). Essentially what I need to be able to add another user role to each user. But I might end up using your solution and adding custom code to it. Commented Oct 11, 2017 at 8:24