Opened 12 months ago
Last modified 12 months ago
#59552 new defect (bug)
Rest api not returns embedded data,if i use at least one field.
Reported by: | sashakozlovskiy | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Embeds | Keywords: | |
Focuses: | rest-api | Cc: |
Description
Hello. after updating of wordpress,rest api not returns embedded data,if we use at least one field,so we downgraded wordpress,but created test subdomain,which contains latest wordpress. Please compare requests:
https://опиши-мне.рф/wp-json/wp/v2/posts/5926/?_fields=content&_embed=author,wp:term
and
https://2019.опиши-мне.рф/wp-json/wp/v2/posts/5926/?_fields=content&_embed=author,wp:term
in second case it returns only content field,but in first - content field and embedded data. Please help to us fix this issue. Thank you very much.
Change History (6)
#2
@
12 months ago
Ok,but whether you updated it in rest api book and how i can for now get only field content and embedded author and wp:term
#3
@
12 months ago
@sashakozlovskiy In your request, you are not requesting the _embedded fields. It works if you add that
This changed in core back in 2022, see the original make blog post.
#4
@
12 months ago
Thank you very much. Now i understand,what for now i should add field with name _embedded together with content. Because i not understood before,what means _embedded field. Let God bless to you. Please,explain to me,whether it possible exclude embedded parts,for example from links exclude collection,etc.
There was a breaking change in a recent WordPress release where now you need to include the „_embedded“ field (or whatever the key is called) as well if you do something like this.