Inpsyde\MultilingualPress\Module\CustomPostTypeSupport\TypeSafePostTypeRepository::get_supported_post_types PHP Method

get_supported_post_types() public method

Returns the slugs of all currently supported post types.
Since: 3.0.0
public get_supported_post_types ( ) : string[]
return string[] The slugs of all currently supported post types.
    public function get_supported_post_types()
    {
        $settings = $this->get_settings();
        if (empty($settings[PostTypeRepository::SETTINGS_KEY])) {
            return [];
        }
        $post_types = $settings[PostTypeRepository::SETTINGS_KEY];
        $post_types = array_filter($post_types, function ($setting) {
            return PostTypeRepository::CPT_INACTIVE !== $setting;
        });
        return array_keys($post_types);
    }