Updated for WordPress 4.0