REST API `include` parameter ignored when also using `context`
-
Hi, I develop the plugin Print My Blog, which sends REST API requests like
http://mysite.test/wp-json/wp/v2/posts?include=1234&context=editwhich normally works fine. But when PublishPress Permissions is active on the site, theinclude=1234request 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, eghttp://mysite.test/wp-json/wp/v2/posts?include=1234works fine.There’s a warning that might be a clue. When I send a request to
http://mysite.test/wp-json/wp/v2/posts?include=1234&context=editorhttp://mysite.test/wp-json/wp/v2/posts?context=editI 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=editparameter.So, any idea on how to get the
includeparameter to work while usingcontext=editand PublishPress Permissions active?
The topic ‘REST API `include` parameter ignored when also using `context`’ is closed to new replies.