0

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.

2
  • there is no "Other Roles" in WordPress. it's certainly a plugin which add this. have you the extension "User Role Editor" e.g.
    – mmm
    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. Oct 10, 2017 at 17:23

1 Answer 1

1

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");

});
1
  • 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. Oct 11, 2017 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.