Wordpress Custom Post Type OOP Function that can be reused for various CPT