- Navigate to the ch2-twitter-embed folder of the WordPress plugin directory of your development installation.
- Open the ch2-twitter-embed.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__, 'ch2te_set_default_options_array' ); function ch2te_set_default_options_array() { ch2te_get_options();}function ch2te_get_options( $id = 1 ) { $options = get_option( 'ch2te_options_' . $id, array() ); $new_options['setting_name'] = 'Default'; $new_options['width'] = 560; $new_options['number_of_tweets'] = 3; $merged_options = wp_parse_args( $options, $new_options ); $compare_options = array_diff_key( ...