0

To prevent inadvertent switching, I want to remove two options from the the dashboard:

  1. Membership.(In Settings-General - options-general.php.)
  2. Visual editor. (in Users-profile - profile.php.)

I want the default text and check-boxes to be replaced by a message of 'This option has been disabled.

With css I can hide the boxes and add a message, but I'd rather the html was absent.

I've no idea where to begin with this.

  • It's possible to remove and add items to your WordPress dashboard, but you will need to update your post for precision; what are you referring to by Membership and Visual editor? Third parties plugins? Which are of the dashboard? Menu? Main content? – nyedidikeke Nov 3 '16 at 12:42
  • @nyedidikeke... Updated for clarity, though anyone able to answer is likely to know exactly what's being referred to because they're default functions. – glvr Nov 3 '16 at 12:50
  • Visual Editor is an option in Core WP, but Membership isn't – Tom J Nowell Nov 3 '16 at 13:24
  • @Tom J Nowell... maybe my words are wrong... isn't the 'Anyone can register' option a default feature? – glvr Nov 3 '16 at 16:14
0

You can use the remove_menu_page function from the admin_menu action.

An example for you would be to add this to your functions file (this will remove those menu links for you as well).

function remove_menus() {

    remove_menu_page( 'options-general.php' );
    remove_menu_page( 'profile.php' );

}

add_action( 'admin_menu', 'remove_menus' );

If you need to be more specific to a user group, or an individual user (or exclude a user) you can use things like current_user_can or get_current_user_id to be more specific.

  • @socki03...thanks. That removes the menu items - which isn't what I want. Those pages need to be present, but with each having a specific option removed. – glvr Nov 3 '16 at 16:12
  • Oh, sorry, I misread what you needed. Without editing the core templates, I'm not sure you can remove those specific sections. And you should really never edit core templates. – socki03 Nov 3 '16 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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