[wp-trac] [WordPress Trac] #18709: Hooks in user-new.php

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 21 15:57:12 UTC 2011


#18709: Hooks in user-new.php
-----------------------------+------------------------------
 Reporter:  standardtoaster  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Administration   |     Version:  3.2.1
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by strangerstudios):

 I think the OP meant to add form fields and other code to the actual form
 in user-new.php... similar to "edit_user_profile" and "show_user_profile"
 in user-edit.php.

 I'd like to do something similar, and wonder why this hook isn't in place
 already.

 Attached is a patch which just adds a "new_user_profile" action above the
 roles. (FYI, I created the diff against 3.3-beta2-19067)

 A hack to work around not having this hook is to use the
 "show_password_fields" hook/filter. That hook seems to only be used on the
 user-new.php and user-edit.php page. It's meant to check if the password
 field should be shown, but you can output code at that point to add things
 to the form. You can check __FILE__ or $_SERVER['PHP_SELF'] to distinguish
 between the new/edit user pages.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18709#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list