checking if post id is false before getting post for selected rows and removing duplicate get_post_type_object call