- Navigate to the WordPress plugin directory of your development installation.
- Create a new directory called ch11-hello-world.
- Navigate to the directory and create a text file called ch11-hello-world.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 11 - Hello World.
- Add the following line of code to register a function to be called when the plugin is activated:
register_activation_hook( __FILE__, 'ch11hw_set_default_options_array' );
- Insert the following block of code to provide an implementation for the ch11hw_set_default_options_array function:
function ch11hw_set_default_options_array() { if ( false === get_option( 'ch11hw_options' ) ) { ...