- Navigate to the WordPress plugin directory of your development installation.
- Create a new directory called ch3-settings-api.
- Navigate to this directory and create a new text file called ch3-settings-api.php.
- Open the new file in a code editor and add an appropriate header at the top of the plugin file, naming the plugin Chapter 3 - Settings API.
- Add the following line of code to register a function that will be called when WordPress activates the plugin:
register_activation_hook( __FILE__, 'ch3sapi_set_default_options' );
- Add the following code section to provide an implementation for the ch3sapi_set_default_options function to set default plugin options:
function ch3sapi_set_default_options() { ch3sapi_get_options(); ...