• Resolved sagund07

    (@sagund07)


    Hi and welcome to another question regarding my favorite topic ??

    Is there a way to filter events by teams? I already know how to filter the events by league and season but the list is still too long and it requires too many time to fetch the data.

    I tried to use filter[sp_team(s)] and after “=” I tried the teamslug and the team ID but nothing seems to work.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Brian

    (@brianmiyaji)

    @sagund07 thanks for your question! The filter in this case would be using the sp_team meta value, so try this:
    filter[meta_key]=sp_team&filter[meta_value]=123

    (replace 123 with the team ID)

    • This reply was modified 8 years ago by Brian.
    • This reply was modified 8 years ago by Brian.
    Thread Starter sagund07

    (@sagund07)

    @brianmiyaji Thanks! The loading times are a lot better now ??

    • This reply was modified 8 years ago by sagund07.
    Roch

    (@rochesterj)

    You’re most welcome!

    Let us know if you need anything else.

    Kind Regards,
    -Roch

    ilyachg

    (@ilyachg)

    I have the same problem.
    Where should I put this line?

    Thread Starter sagund07

    (@sagund07)

    Hey,

    you have to add this to your REST API URL

    https://yourdomain.com/wp-json/sportspress/v2/events?filter[meta_key]=sp_team&filter[meta_value]=teamid

    ilyachg

    (@ilyachg)

    ……… https://www.hc-impuls.ru/ …….. not work after install REST API :(((

    ilyachg

    (@ilyachg)

    i delete REST API plugin. My site work now

    ilyachg

    (@ilyachg)

    i know my mistake… i have wordpress 4.0!

    Roch

    (@rochesterj)

    BTW a new topic is the way to go ??

    Kind Regards,
    -Roch

    Plugin Contributor Savvas

    (@savvasha)

    In WordPress 4.7 the filter argument for any post endpoint was removed.

    What is the alternative?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘REST API: Filter events by team’ is closed to new replies.