This commit is contained in:
Sven Steinert
2026-05-13 11:57:52 +02:00
parent 6abf6f9c3d
commit f4511b9213
76 changed files with 4494 additions and 1940 deletions

View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace KbMarkdownImporter\Repository;
final class VersionRepository
{
public function ensure(string $version): int
{
$term = term_exists($version, 'kb_version');
if (! $term) {
$term = wp_insert_term($version, 'kb_version', ['slug' => sanitize_title($version)]);
}
return is_wp_error($term) ? 0 : (int) ($term['term_id'] ?? $term);
}
}