fix undefined var $post_type