funkhaus / fuxt-api

A WordPress plugin that extend the WP-JSON API to work with the fuxt framework.
0 stars 0 forks source link

Bug: Menu endpoint by name stopped working #38

Closed drewbaker closed 1 week ago

drewbaker commented 1 week ago

https://see-me-api.flywheelsites.com/wp-json/fuxt/v1/menus?name=Main%20Menu

Screenshot 2024-10-11 at 10 57 56 AM Screenshot 2024-10-11 at 10 57 43 AM

drewbaker commented 1 week ago

OK so the problem is that the encoded params become Main%20Menu and WordPress doesn't handle the decoding on those params now.

So in class-rest-menu-controller.php I added a urldecode() around the menu $name param.

Screenshot 2024-10-11 at 11 07 08 AM

@rsm0128 I suspect you will need to do this for all params on other endpoints too.

rsm0128 commented 1 week ago

@drewbaker I fixed the issue in this commit https://github.com/funkhaus/fuxt-api/commit/81b7899296fe2a967737557a2d032c018b5ec246