[wp-trac] [WordPress Trac] #40765: Not able to get contents after more tag.
WordPress Trac
noreply at wordpress.org
Wed Oct 30 18:59:14 UTC 2024
#40765: Not able to get contents after more tag.
-------------------------------+-------------------------
Reporter: mukeshbeniwal | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Posts, Post Types | Version: 4.7.4
Severity: normal | Resolution: worksforme
Keywords: reporter-feedback | Focuses:
-------------------------------+-------------------------
Comment (by thiscantbe):
To fetch the entire content of a WordPress post via the REST API, there
are two useful parameters: _embed and fields. The _embed parameter, when
added as ?_embed to the URL, tells WordPress to return embedded data,
including the post’s full content, as shown in /wp-
json/wp/v2/posts/{id}?_embed. Alternatively, you can specify the desired
fields using the fields parameter to control the response. By adding
content.rendered to the request URL like this: /wp-
json/wp/v2/posts/{id}?fields=id,title,content.rendered, you’ll receive
only the essential fields, including the full content. Both approaches
enable you to retrieve complete content instead of just a preview or
excerpt.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40765#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list