<?php

namespace Blazemedia\Affiliation\Support\Traits;

// TODO:: Refactoring perch* + un trait?

trait PostTypes
{
    private static function definePostTypes(array $options): void
    {
        $value = $options['post_types'] ?? '';
        $value = empty($value) ? $options['post_types_0'] : $value;

        $values = empty($value) ? '[]' : json_encode(explode(',', $value));
        

        if (!defined('BLAZE_AFFILIATION_POST_TYPES')) {
            define('BLAZE_AFFILIATION_POST_TYPES', $values);
        }
    }
}
