Support » Plugin: PublishPress Permissions: Control Access for Posts, Pages, Categories, Tags » REST API `include` parameter ignored when also using `context`

  • Resolved Michael Nelson


    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=edit which normally works fine. But when PublishPress Permissions is active on the site, the include=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, eg http://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 http://mysite.test/wp-json/wp/v2/posts?include=1234&context=edit or http://mysite.test/wp-json/wp/v2/posts?context=edit I get

    Warning: 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 using context=edit and PublishPress Permissions active?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.