Similar to the taxonomy editor, the user editor allows developers to add extra fields through action hooks and facilitates this task by using the same HTML structure, whether a new user is being created or an existing one is modified. This recipe shows how to assign a callback function to add a new section to the user editor.
To create a complete plugin with a stylesheet and administration panel, you should have already followed the Storing stylesheet data in user settings recipe in Chapter 3, User Settings and Administration Pages, to have a starting point for this recipe. Alternatively, you can get the resulting code (
Chapter 3/ch2-private-item-text-edit-stylesheet/ch2-private-item-text.php) from the downloaded code bundle and rename
It is also possible to just create a new empty plugin file and follow this chapter's recipes by making a folder called