Do I have to override the wp_mail() pluggable function with writing a plugin?

Yes you need to use a plugin. Point is that pluggables are between hard and impossible to control. You can read through this thread on wp-hackers about the actual problems and why you shouldn’t use them. Important: Note: pluggable.php loads before the ‘plugins_loaded’ hook. This means that you need the “MU-plugins” (Must use) hook: mu_plugins_loaded … Read more

Getting Details Of Uploaded Image

The attachment metadata stored for the image is: Array ( [width] => 558 [height] => 771 [hwstring_small] => height=”62″ width=”128″ [file] => 2012/02/logo2.png [sizes] => Array ( [thumbnail] => Array ( [file] => file_name.png [width] => 150 [height] => 150 ) [medium] => Array ( [file] => logo2-300×145.png [width] => 300 [height] => 145 ) … Read more

Prevent plugin from deleting important directories

To answer my own question here is what I’ve found for the sake of keeping questions answered. What this does is copying the important directory before upgrade and recovering it after upgrade: function my_dir_copy($source, $dest) { if (is_link($source)) { return symlink(readlink($source), $dest); } if (is_file($source)) { return copy($source, $dest); } if (!is_dir($dest)) { mkdir($dest); } … Read more

Add Submenu Link in add_submenu_page That Opens in a New Window

This has to be solved: with an unconventional submenu manipulation, provided by @t31os in this Answer and some jQuery add_action( ‘admin_menu’, ‘wpse_66020_admin_menu_new_item’ ); add_action( ‘admin_head’, ‘wpse_66020_add_jquery’ ); function wpse_66020_admin_menu_new_item() { global $submenu; $submenu[‘index.php’][500] = array( ‘<div id=”wpse-66020″>Go to WPSE</div>’ , ‘manage_options’ , ‘https://wordpress.stackexchange.com/’ ); } function wpse_66020_add_jquery() { ?> <script type=”text/javascript”> jQuery(document).ready( function($) { $(‘#wpse-66020’).parent().attr(‘target’,’_blank’); … Read more