I have 2 custom post type (songs, artists) that are connected with each other by relation field, every songs post have a relation field that store artist that relate the song post.

I'm getting data for mobile app via rest API but I need filter API result post based on ACF field like getting songs post that related to an artist post.

Rest API : http://www.example.com/wp-json/wp/v2/songs

I need something like : http://www.example.com/wp-json/wp/v2/songs?artist=1234 that return songs post that artist field is 1234

I found some tutorial but they are more than 2 years old and don't work now.

  • Can You share Your register_rest_route function for this endpoint ? – Beronriw May 3 '18 at 18:04
  • i don't understand , this endpoint relate to custom post type – ebeliejinfren May 4 '18 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.