Updated to work with Wordpress 3.8