Timber\PostGetter::get_class_for_use_as_timber_post PHP Method

get_class_for_use_as_timber_post() public static method

public static get_class_for_use_as_timber_post ( string | array $arg ) : string | boolean
$arg string | array
return string | boolean if a $type is found; false if not
    public static function get_class_for_use_as_timber_post($arg)
    {
        $type = false;
        if (is_string($arg)) {
            $type = $arg;
        } else {
            if (is_array($arg) && isset($arg['post_type'])) {
                $type = $arg['post_type'];
            }
        }
        if (!$type) {
            return false;
        }
        if (!is_array($type) && class_exists($type) && is_subclass_of($type, '\\Timber\\Post')) {
            return $type;
        }
    }