Skip to content

Commit 71e57fa

Browse files
authored
New post error fix (#2)
* refactor: update invalidateCache signature to int|string|null * Update CacheInvalidator.php
1 parent 6f8e2af commit 71e57fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Services/CacheInvalidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function registerHooks(): void
3838
add_action('deleted_term', [$this, 'invalidateCache']);
3939
}
4040

41-
public function invalidateCache(?int $postId = null): void
41+
public function invalidateCache(int|string|null $postId = null): void
4242
{
4343
// Only invalidate for configured post types
4444
if ($postId && ! $this->shouldInvalidateForPost($postId)) {
@@ -71,7 +71,7 @@ public function handleMetaDelete(array $metaIds, int $postId): void
7171
$this->invalidateCache($postId);
7272
}
7373

74-
protected function shouldInvalidateForPost(int $postId): bool
74+
protected function shouldInvalidateForPost(int|string $postId): bool
7575
{
7676
$postType = get_post_type($postId);
7777
$configuredTypes = config('llms-txt.post_types', ['post', 'page']);

0 commit comments

Comments
 (0)