Creating an administration page menu item in the settings menu
After defining default values for plugin configuration options, the next step to creating a plugin configuration page is to build a place where users will be able to view and change these values. By using the WordPress API, we can create new items in the administration menu that will later allow us to create custom plugin configuration pages.
You should have already followed the Storing user settings using arrays recipe to have options data available to manage. Alternatively, you can get the resulting code (
ch3/ch2-page-header-output/ch2-page-header-output-v3.php) from the book's GitHub page. You should rename the file
ch2-page-header-output.php before starting this recipe.
How to do it...
Follow these steps to create a new menu item that will appear under the Settings subsection of the administration menu:
- Navigate to the root directory of your WordPress...