Fixes #1716 for post types