get_file_system(); $this->migrations = array( new Migration_Post_Type( $logger, $view_cpt_settings_storage, $this->get_views_cpt(), $layouts_cpt ), new Migration_Post_Type( $logger, $card_cpt_settings_storage, $this->get_cards_cpt(), $selections_cpt ), new Migration_Fs_Field( $logger, $file_system, 'view.php', 'controller.php' ), new Migration_Fs_Field( $logger, $file_system, 'card.php', 'controller.php' ), ); } public function get_upgrade_notice_text(): string { return __( 'Views are now called Layouts and Cards are called Post Selections. Same great features, just easier to use!', 'acf-views' ); } protected function get_views_cpt(): Plugin_Cpt { return $this->make_cpt( 'acf_views', 'view_', 'views' ); } protected function get_cards_cpt(): Plugin_Cpt { return $this->make_cpt( 'acf_cards', 'card_', 'cards' ); } protected function make_cpt( string $cpt_name, string $slug_prefix, string $folder_name ): Plugin_Cpt { return new class( $cpt_name, $slug_prefix, $folder_name ) extends Plugin_Cpt_Base { public function __construct( string $cpt_name, string $slug_prefix, string $folder_name ) { $this->cpt_name = $cpt_name; $this->slug_prefix = $slug_prefix; $this->folder_name = $folder_name; } }; } }