Skip to content

Commit 5686166

Browse files
committed
fix(wordpress): remove invalid Attachment search subtype, fix listAuthor input type
- Search Content's "Content Type" dropdown offered Attachment, which maps to subtype=attachment. WP core's WP_REST_Post_Search_Handler explicitly excludes attachment from valid subtypes (media isn't searchable via /search) — selecting it guaranteed a 400 rest_invalid_param. Removed the option; only Post/Page (the only valid subtypes) remain. - listAuthor was declared type: 'string' in the inputs catalog despite being Number()-coerced before use, inconsistent with every other ID-like field (postId, pageId, categoryId, commentParent, etc. are all 'number'). Found by an independent final pre-merge validation pass, requested before merge to be certain of full API alignment.
1 parent 44a6963 commit 5686166

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

apps/sim/blocks/blocks/wordpress.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ export const WordPressBlock: BlockConfig<WordPressResponse> = {
631631
{ label: 'All Types', id: '' },
632632
{ label: 'Post', id: 'post' },
633633
{ label: 'Page', id: 'page' },
634-
{ label: 'Attachment', id: 'attachment' },
635634
],
636635
value: () => '',
637636
mode: 'advanced',
@@ -1132,7 +1131,7 @@ export const WordPressBlock: BlockConfig<WordPressResponse> = {
11321131
slug: { type: 'string', description: 'URL slug' },
11331132
categories: { type: 'string', description: 'Category IDs (comma-separated)' },
11341133
tags: { type: 'string', description: 'Tag IDs (comma-separated)' },
1135-
listAuthor: { type: 'string', description: 'Filter posts by author ID' },
1134+
listAuthor: { type: 'number', description: 'Filter posts by author ID' },
11361135
featuredMedia: { type: 'number', description: 'Featured media ID' },
11371136
// Page inputs
11381137
pageId: { type: 'number', description: 'Page ID' },
@@ -1174,8 +1173,7 @@ export const WordPressBlock: BlockConfig<WordPressResponse> = {
11741173
query: { type: 'string', description: 'Search query' },
11751174
searchType: {
11761175
type: 'string',
1177-
description:
1178-
'Content subtype filter (post, page, attachment) — maps to the API subtype param',
1176+
description: 'Content subtype filter (post, page) — maps to the API subtype param',
11791177
},
11801178
// List inputs
11811179
perPage: { type: 'number', description: 'Results per page' },

0 commit comments

Comments
 (0)