- Navigate to the ch2-private-item-text folder of the WordPress plugin directory of your development installation.
- Open the ch2-private-item-text.php file in a text editor.
- Add the following lines of code to implement an activation callback to initialize plugin options when it is installed or upgraded:
register_activation_hook( __FILE__, 'ch2pit_get_options' ); function ch2pit_get_options() { $options = get_option( 'ch2pit_options', array() ); $stylesheet_location = plugin_dir_path( __FILE__ ) . 'stylesheet.css'; $new_options['stylesheet'] = file_get_contents( $stylesheet_location ); $merged_options = wp_parse_args( $options, $new_options ); $compare_options = array_diff_key( $new_options, $options ); if ( empty( $options ...