How to Add WYSIWYG Editor (tinyMCE) to plugin options page compatible with WordPress 3.0 and up?

Pre WP 3.3: http://www.dev4press.com/2010/tutorials/wordpress/tips/add-rich-text-editor-to-your-plugin/ If you are using WP 3.3 or later you might look up wp_editor: http://codex.wordpress.org/Function_Reference/wp_editor $settings = array( ‘teeny’ => true, ‘textarea_rows’ => 15, ‘tabindex’ => 1 ); wp_editor(esc_html( __(get_option(‘whatever_you_need’, ‘whatever’))), ‘terms_wp_content’, $settings);

Is it bad practice to create own table for a plugin?

I rarely disagree with otherwise knowledgeable users, but in this case I can’t help it. In my opinion calling the usage of non-core database tables bad practice per se is just simply wrong. The choice of whether to go with core tables or add your own depends on several factors. A query’s execution time depends … Read more

wp_dequeue_style not working

Okay so I figured this one out. function custom_dequeue() { wp_dequeue_style(‘et-gf-open-sans’); wp_deregister_style(‘et-gf-open-sans’); } add_action( ‘wp_enqueue_scripts’, ‘custom_dequeue’, 9999 ); add_action( ‘wp_head’, ‘custom_dequeue’, 9999 ); @milo was right. The plugin was re-enqueueing it so the deregistering it got that file to stop loading. Then the plugin also had another check, where it would register and enqueue another … Read more

Why is it important to deactivate a plugin before deleting it?

Generally, plugins have some functionality hooked onto the deactivation action. This could be clearing cache, resetting options, you name it. Therefore the best practice is to deactivate them first, so they have the opportunity to clean up and execute whatever functionality they have hooked onto the deactivate event. Now if the plugin is broken and … Read more

Disable /wp-admin/plugin-install.php

There is a constant you can define in wp-config.php to do this. It will also disable the theme edit, however. <?php // somewhere in wp-config.php define(‘DISALLOW_FILE_MODS’, true); That will remove the plugin and theme file editor (which are a terrible idea anyway) and remove the ability to install plugins and themes from the admin area.

How to create custom message on plugin update

This message is created by W3_Total_Cache->in_plugin_update_message() hooked to “in_plugin_update_message-$file”in wp_plugin_update_row(). It does some nifties to parse readme and display info from changelog, but overall you can just echo some stuff as with any other hook.

Turn Off Auto Update for Single Plugin

you place this in your theme’s functions.php // Disable update notification for individual plugins – see my example of plugin block-spam-by-math-reloaded as to how to use this function function filter_plugin_updates( $value ) { unset( $value->response[‘plugin-folder-name/plugin-file-name.php’] ); return $value; } add_filter( ‘site_transient_update_plugins’, ‘filter_plugin_updates’ );

Custom media upload content for inserting custom post shortcode

Have a look at my guide here – http://www.wpexplorer.com/wordpress-tinymce-tweaks/ – so you can see how to create a popup window where you can select your options than insert a shortcode. If you download my Free Symple Shortcodes plugin you can see a live implementation as well. Instead of having the user select the posts to … Read more

Hooking in to plugins

@Ryan Elkins: I guess the answer depends on how import each use-case is to you. In some cases it would be something you need quick-and-dirty, in others it might be a more significant use-case. Here are the two things that come to mind: Look for Alternate Hooks within WordPress Core If it’s something quick and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)