Configuring “Content is selected page” causing odd REST impact
-
When I’m adding a “Content is selected page” restriction I get prompted to search for the page this applies to. Two issues:
- The list returned includes other post types, i.e. not just “pages”;
- The request appears to involve accessing all my page’s content – rather than just searching the page title. This includes triggering any shortcodes on those pages.
It appears the request that is being submitted is:
/wp-json/wp/v2/pages?context=view&search=a&per_page=100&_locale=user
Re the first point, it looks like the &search parameter effectively overrsides the “pages” and searches all (searchable) post types.
Re the second point, can you limit the fields returned (as most are not needed), e.g. add argument &_fields=title so just the page title is returned. Or maybe &_fields=type,title so you can also remove those non-pages (as per previous point).
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.