The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
I expected this to work, but it does not. Frontity can not fetch my Quote CPT, as it gets REST API error. If I remove orderby: "menu_order", itās working as expected. I am doing something wrong, or itās a bug?
Thanks!
mmczaplinski2
Hi @koli14!
Sounds like it might be a bug in frontity! Weāre investigating on our end, but in the meantime could you:
Post the error message that you receive.
Check if the same error occurs if you add the query parameter directly to the url in api like: https://mysite.com/wp-json?order_by=menu_order and remove the orderby: "menu_order", from params.
Thanks!
koli143
Thanks @mmczaplinski! Here is the Error message, I get in the browser console:
If I do not use the Quote CPT, then itās working as expected.
I do not really understand your second question.
If I use globally e.g. orderby: author, and on my Quote CPT orderby: date, then my code is working, but the Quotes will be ordered by author and not by date. (as Quote can be ordered by author). So I get the error only because Quote can not be ordered by menu_order (which I do not want anywayā¦).
mmczaplinski7
Hey @koli14!
It seems like this is an error in WordPress, not in Frontity.
You are using a filter to add menu_order but it will work only for posts, because youāre using rest_post_collection_params .
Hey @mmczaplinski!
Yes, Iām aware of that. As I wrote, I do not want to order the quotes by menu_oder but by date.
But here is an other example where the bug is visible, without menu_order:
I write following into my frontity.settings.js to set the order globally to slug, but the Quote to date:
What you are trying to achieve is currently not possible with Frontity, unfortunately. We do not support the params inside of postTypes at the moment, although I admit that it was reasonable on your part to expect it to work this way!
I have opened a new feature request for this so that you can see what the status of it is in the future!
1 Like
koli1414
Thanks @mmczaplinski! This example from the docs is what confused me: