• Hi all,

    I’m attempting to remove default fields on the user-edit.php page in the WP backend.

    After searching the Codex and online forums, the closest I’ve come to a solution is:

    function add_twitter_contactmethod( $contactmethods ) {
      unset($contactmethods['aim']);
      unset($contactmethods['jabber']);
      unset($contactmethods['yim']);
      return $contactmethods;
    }
    add_filter('user_contactmethods','add_twitter_contactmethod',10,1);

    Which is great and seems to be on the right track – except I can’t seem to find actual documentation and/or an index of all the different field names. For example, how do I unset the ‘Choose your Color Scheme’ field?

    My temporary solution is to hide the fields via CSS but this is obviously not ideal, and is more of a hack than a proper solution. It also has its limits since I can’t specifically target section headings.

    Any ideas or leads?

Viewing 1 replies (of 1 total)
  • Hello matthewtvogel,

    I have done this tactic using jQuery in my one of the project.

    You can place below code in your plugin.

    <?php
    add_action('admin_head','hide_personal_options');
    function hide_personal_options() { ?>
        <script type="text/javascript">
        jQuery(document).ready(function($) {
        	$("#email").parent().parent().remove();  // Add id of email or whatever you want to hide
             $(".user-admin-color-wrap").hide(); //To disable Admin Color Scheme
        });
        </script>
    <?php }

    I have searched lot on google but nothing found helpful for the same till now.

    Let me know if this helps you.

Viewing 1 replies (of 1 total)

The topic ‘unset(…) documentation for removing default fields’ is closed to new replies.