yajuve
Forum Replies Created
-
Thanks @rochesterj for your answer
I suggest just to add it in the futur version of SportsPress plugin
And add search by Matchday in admin interfaces (Matches > Matches)
like filter by team, league and season
I think that it’s not very hard to add this feature.
Thank you in advance- This reply was modified 7 years, 6 months ago by yajuve.
Hi,
I found how you can add new field in API RESTFirst add this function in : sportspress/includes/class-sp-event.php
public function day() { $day = get_post_meta( $this->ID, 'sp_day', true ); if ( '' === $day ) $day = 'empty'; return $day; }
Then in sportspress/includes/api/class-sp-rest-api.php
addregister_rest_field( 'sp_event', 'day', array( 'get_callback' => 'SP_REST_API::get_post_data', 'update_callback' => 'SP_REST_API::update_post_meta_arrays', 'schema' => array( 'description' => __( 'Results', 'sportspress' ), 'type' => 'array', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'rest_sanitize_request_arg', ), ), ) );
The name of function ‘day’ must be match $attribute (second attribute) in register_rest_field function.
Best regards
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] REST API with filtersHi!
Unfortunately ?? …
Thank you Rock for the information,
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Problem with post?filter[tag]Same issue
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] REST API with filtersSo at this time no solutions to use filter with Sportspress ?
Thanks @rochesterj @savvashaForum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] REST API with filtersHi Roch,
I tried this example : sportspress/v2/teams?filter[sp_league]=primary-league
of course i changed the slug ‘primary-league’ , but it didn’t work, it shows me all teams,About what i need : i want to get all events for specified seasons
for example : sportspress/v2/events/?filter[seasons]=69 or with slug sportspress/v2/events/?filter[seasons]=slug,sorry for my many requests
Thaaank you Rock,
Forum: Plugins
In reply to: [SportsPress - Sports Club & League Manager] REST API with filtersHi!
Thank you Rock ?? for your answer,
Would you give me just an example : the syntax of URI ?Thanks,