changed type_id to post_type_id