Replies: 1 comment 5 replies
-
(Sounds like something possibly addressed by #2680 ) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I removed the slugs from some of my CPTs with a filter and an action, hooking into
post_type_link
andpre_get_posts
. However, this doesn't seem to affect the URIs as used by WPGraphQL. I have a post type namedcase
for example. The only way to get any case posts throughnodeByUri
is to use the URI including the "original" slug, i.e.nodeByUri(uri: "/case/test-case/")
, even though in the WordPress admin, the permalink is shown as/test-case/
. I am also able to access the case post through the normal WordPress frontend on that URI.How can I access my "slugless" CPTs with
nodeByUri
, using the slugless version of the URI?Code to register the post type:
Code to remove the slugs:
Beta Was this translation helpful? Give feedback.
All reactions