• Resolved Michael Nelson

    (@mnelson4)


    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, 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 https://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 or https://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)
  • The topic ‘REST API `include` parameter ignored when also using `context`’ is closed to new replies.