Updated to work on WordPress 3.9