REST API `include` parameter ignored when also using `context`
-
Hi, I develop the plugin Print My Blog, which sends REST API requests like
https://mysite.test/wp-json/wp/v2/posts?include=1234&context=edit
which normally works fine. But when PublishPress Permissions is active on the site, theinclude=1234
request parameter is ignored, so instead of just returning post 1234, ALL posts get returned.What’s strange is the issue doesn’t happen if you’re not using
context=edit
, eghttps://mysite.test/wp-json/wp/v2/posts?include=1234
works fine.There’s a warning that might be a clue. When I send a request to
https://mysite.test/wp-json/wp/v2/posts?include=1234&context=edit
orhttps://mysite.test/wp-json/wp/v2/posts?context=edit
I getWarning: Invalid argument supplied for foreach() in [..]\wp-content\plugins\press-permit-core\modules\presspermit-collaboration\classes\Permissions\Collab\RESTInit.php on line 62
I hope this info helps. Sorry I don’t have a URL to share as you need to be logged-in to use the
context=edit
parameter.So, any idea on how to get the
include
parameter to work while usingcontext=edit
and PublishPress Permissions active?
- The topic ‘REST API `include` parameter ignored when also using `context`’ is closed to new replies.