Add Button to TinyMCE Custom Menu

That looks like it is an error due to TinyMCE (editorremov I believe) not being loaded yet. Either hook to the admin_footer action instead of admin_head (interestingly you have declared the in_footer option as true and it is still not working) or declare the editorremov dependency when enqueuing your script: wp_enqueue_script( ‘features’, plugin_dir_url( __FILE__ ) … Read more

Am I correctly adding styles to plugin?

Yes, This is the correct way. Many of us use styles to alter the look of our website, and scripts to enhance functionality. It is important to note however, that the way you add these scripts to WordPress is just as important as the content of these files. Instead of plopping them into the header … Read more

How to save default values into an option and delete those upon actvation and deactivation in wordpress?

The following code worked. According to the comment by Milo, I have been doing it wrong by using the option name. So instead I used each keys from the option and used the array to pass the defaults. Thanks milo! :_ register_activation_hook( __FILE__, ‘twmm_activate’); //activate plugin options open activation of plugin register_deactivation_hook(__FILE__, ‘twmm_deactivate’); //deactivate plugin … Read more

How can I see a varibles value when my plugin runs?

Using the following modifications and adding in die() stopped the script and output whatever the variables value was at that time. Thanks to @toscho function cf7pp_after_send_mail( $contact_form ) { global $postid; $submission = WPCF7_Submission::get_instance(); if ( $submission ) { $posted_data = $submission->get_posted_data(); $postid = $posted_data[‘_wpcf7’]; $enable = get_post_meta( $postid, “_cf7pp_enable”, true); $email = get_post_meta( $postid, … Read more