Create a Meta Box in the Admin User Screen?

My client wants the New User admin page to be composed of a meta box.

add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );

But this seems to be for posts only ($post_type).
Is there an alternative for the User screen?

Related posts

Leave a Reply

1 comment

  1. Well, as you already know, meta boxes are for post types only

    What you can do is to customize the heck out of that screen.

    What follows is the code I used on a client’s custom theme.
    Originally, it was used with the action hook admin_print_scripts-profile.php (which could also be added bellow).

    /functions.php:

    add_action( 'admin_print_scripts-user-new.php', 'wpse_66477_customize_profile' );
    
    function wpse_66477_customize_profile() {
        wp_register_style( 'wpse_66477_css', get_template_directory_uri() . '/css/profile.css' );
        wp_enqueue_style( 'wpse_66477_css' );
        wp_register_script( 'wpse_66477_js', get_template_directory_uri() . '/js/profile.js' );
        wp_enqueue_script( 'wpse_66477_js' );
    }
    

    /css/profile.css:

    #contextual-help-link-wrap { display: none !important; }
    
    description,h2,h3,#icon-profile,#icon-users,#ozhmenu_wrap,.editform {
    display:none
    }
    
    #your-profile {
    width:485px;
    padding:15px
    }
    
    body {
    font-family:Verdana;
    font-size:10px;
    color:#ccc
    }
    
    #wpbody-content {
    width:500px;
    background-color:#fff;
    border:1px solid #C3C3C3;
    margin:20px 20%;
    padding:0 30px 0 0
    }
    
    #wpwrap {
    display:none;
    background-color:#F6F6F6
    }
    
    .form-table th {
    width:120px;
    text-align:right
    }
    
    p.help,p.description,span.description,.form-wrap p {
    font-size:9px;
    font-family:Verdana
    }
    
    .description {
    line-height:11px
    }
    
    input.button-primary,button.button-primary,a.button-primary {
    border:0;
    font-weight:normal;
    color:black;
    background:#6EAC51;
    text-shadow:none;
    height:17px
    }
    
    .form-table td {
    margin-bottom:9px;
    line-height:9px;
    font-size:10px;
    padding:0 10px
    }
    
    .submit {
    border:0;
    text-align:center;
    margin:0 auto
    }
    
    .submit input,.button,input.button,.button-primary,input.button-primary,.button-secondary,input.button-secondary,.button-highlighted,input.button-highlighted,#postcustomstuff .submit input {
    -webkit-border-radius:0!important;
    border-radius:0!important;
    padding:5px 25px
    }
    
    #pass-strength-result {
    margin-top:3px
    }
    
    #pass1 {
    margin-top:5px
    }
    

    /js/profile.js:

    jQuery(document).ready( function($) {
        $("#wpwrap").fadeIn(1500);  
        $("#display_name").parents("tr").hide();
        $("#nickname").parents("tr").hide();
        $("#url").parents("tr").hide();
        $("#password .description").css("display","inline");    
        $('#wpbody-content').prepend('<div style="margin-left: 141px; padding-top: 20px;"><img src="http://example.com/img/logo.png" alt="Site logo, goes to main page" title="" width="240" height="80"></div>');
    });