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; } }