A typical first step of most user-configurable plugins is to create a default set of values for all options when the plugin is activated. These default options will subsequently be used to populate the plugin's settings page when it is visited by the site administrator. This recipe shows how to register a function that is called when a plugin is activated, and how to store option data in the site database.
Creating default user settings on plugin initialization
How to do it...
- Navigate to the WordPress plugin directory of your development installation.
- Create a new directory called ch3-individual-options.
- Navigate to this directory and create a new text file called ch3-individual-options.php.
- Open the new file in a code...