Fixed compatibility with WP 4.0+