Browse: Home / Classes / LD_REST_Courses_Groups_Controller_V2 /


LD_REST_Courses_Groups_Controller_V2::rest_prepare_response_filter( WP_REST_Response $response,  WP_Post $post,  WP_REST_Request $request )

Override the REST response links.

Description #

When WP renders the post response the ‘self’ and ‘collection’ links will have have a path containing the course slug ‘/wp-json/ldlms/v2/sfwd-courses/XXX’ even though the post type is a group. So this function corrects those links to correctly point to the group post.

Parameters #


(WP_REST_Response) (Required) WP_REST_Response instance.


(WP_Post) (Required) WP_Post instance.


(WP_REST_Request) (Required) WP_REST_Request instance.

Source #

File: includes/rest-api/v2/class-ld-rest-courses-groups-controller.php

Changelog #

Version Description
3.3.0 Introduced.