Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision in REST request if post type and taxonomy name start with same string #155

Open
Drivingralle opened this issue Jan 8, 2025 · 0 comments

Comments

@Drivingralle
Copy link

Inside a client project we added a CPT "financing" via this plugin. Also added a taxonomy "financing-connection" to connect another CPT "industries" to the posts inside the "financing" CPT.

At first it look all fine.
But the term selection on the post editor of "industries" was not working.

Requesting the term via the REST-API is returning an empty body as the post editor requests it:
/wp-json/wp/v2/financing-connection?context=view&per_page=100&orderby=name&order=asc&_fields=id%2Cname%2Cparent&_locale=user

Checking the REST endpoint without the _fields parameter is returning fine. But the core adds the fields parameter.

Stepping through the request let's me find that if I unhook the "fill_empty_meta_keys_with_default_values" method the request including the _fields parameter works fine.

After renaming the taxonomy to "connected-financing" everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant