Blog

WordPress REST API order by meta_value

Another quick tip here, for future reference.

I needed to sort the custom posts in a REST API response by a meta value, something like this:

https://www.timrosswebdevelopment.com/wp-json/wp/v2/accommodation?orderby=number_of_beds

Where number_of_beds is a field that has been added using Advance Custom Fields.

The problem is the REST API only allows certain core fields to be used for the orderby param. See my other post on adding REST API orderby custom values for more info. So the question was how to add another.

Continue reading “WordPress REST API order by meta_value”

How to filter WordPress REST API for custom post type by taxonomy slug

I spent ages looking for an answer to my question of how to implement this, I knew that it was possible but I couldn’t seem to find the right answer anywhere. So I’m posting it here for my future reference and in case anyone else finds it.

The issue is compounded by there being so many links to old questions and tutorials for previous versions of the WordPress REST API. As of writing my version of wordpress is 4.9.8. And that makes it REST API v2.

I finally found the answer to my question here on stackexchange.

Continue reading “How to filter WordPress REST API for custom post type by taxonomy slug”

Typo3 6.2 web services with eID and Extbase extensions

I have been having to make a lot of web service end points in Typo3 recently and it drives me mad that there isn’t an out of the box solution in Typo3. It just seems crazy.

So, I though I’d write down the way I’m doing it, to help out anyone else who is struggling.

Continue reading “Typo3 6.2 web services with eID and Extbase extensions”

Debugging Database Queries in Extbase in Typo3 6.2 CMS

If you are using extbase to develop typo3 extentions you can use the Query object to build queries without having to write SQL. The only problem is that if you want to see the actual SQL that is being executed it is hidden from view.

Continue reading “Debugging Database Queries in Extbase in Typo3 6.2 CMS”