Archives for

PHP

Adding dynamic classes to your custom WordPress widgets

I recently released an ad management plugin for WordPress called “Easy AdSense Ads & Scripts Manager“. In this plugin we have a custom widget with option to remove the padding and borders (if any) added by the theme. I did not think much before implementing this feature and was expecting WordPress to have some kind of hook

2 Common errors while setting up phpMyAdmin on Mac OSX

You might encounter the following two errors while installing phpMyAdmin on OSX Login without password is forbidden by the configuration ( See AllowNoPassword ) #2002 can not login tot the MySQL server Here are the fixes for the above two errors. 1. Open phpMyAdmin configuration located at (phpMyAdmin Folder)/config.inc.php and change $cfg[‘Servers’][$i][‘AllowNoPassword’] = False; to

Subtracting two dimensional arrays in PHP

In the development a WordPress plugin I had to subtract two dimensional arrays. I tried array_diff() function, unfortunately it doesn’t seem to work for two dimensional arrays. Even if it worked, it wasn’t exactly the functionality I wanted. Be warned, this isn’t exactly a alternate for array_diff(). For difference of two dimensional arrays you may