It is always useful if the plugin allows you to customize it to your liking. Using external CSS and layout files makes it easier, but what about variables and functions we use in the code?
That is where the plugin options page comes to play. It can be loaded with settings that we can change, and is easily accessible from the WordPress administration panel.
Let's create a few options for our plugin:
Allow the user to choose whether they want to display posts, pages, or both
Start the archive view in mini mode
Allow the user to provide descriptions for each year
The options page may look like this:
In order to have an options page, we need to cover several key functionalities:
Manage our options
Set up the options page
Show the options
Save them after user input
It is actually easier than it may appear to be, and there is no excuse not to have an options page in our plugins anymore!