admin管理员组

文章数量:1277899

I am trying to get a specific post featured_media with getEntityRecords. but I couldn't.

select("core").getEntityRecords("root", "media", { post: 92 })

I am trying to get a specific post featured_media with getEntityRecords. but I couldn't.

select("core").getEntityRecords("root", "media", { post: 92 })
Share Improve this question asked Nov 1, 2021 at 21:57 shadishadi 1301 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

I found the solution... must use getEntityRecord not getEntityRecods:

select("core").getEntityRecord("postType", "attachment", post.featured_media);

本文标签: block editorHow to get featuredmedia of a post with getEntityRecords