protected function check_is_post_type_allowed($post_type) { if (!is_object($post_type)) { $post_type = get_post_type_object($post_type); } if (!empty($post_type) && !empty($post_type->show_in_rest)) { return true; } return false; }