Updated for Wordpress 4.0