Adding custom fields to the user editor
Similar to the taxonomy editor, the user editor allows developers to add extra fields through action hooks. This task is facilitated by using the same HTML structure, whether a new user is being created or an existing one is modified.
Getting ready
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 plugin code directory (ch3/ch2-private-item-text/*
) from the book's GitHub page and rename ch2-private-item-text-v2.php
to ch2-private-item-text.php
.
It is also possible to start fresh and create a new empty plugin file and follow this chapter's recipes by making a folder called ch2-private-item-text
in your plugin directory with a text file called ch2-private-item-text.php
, and only adding...