apply_filters( 'learndash_rest_courses_users_query', array $prepared_args, WP_REST_Request $request )
Filters WP_User_Query
arguments when querying course users via the REST API.
Description #
Parameters #
- $prepared_args
-
(array) An array of arguments for WP_User_Query.
- $request
-
(WP_REST_Request) The REST request object.
Source #
File: includes/rest-api/v1/class-ld-rest-courses-users-controller.php
Examples #
Note: Extended code example below not guaranteed, you may need to consult with a developer
<?php /** * Example usage for learndash_rest_courses_users_query filter. */ add_filter( 'learndash_rest_courses_users_query', function( $prepared_args, $request ) { // May add any custom logic using $prepared_args, $request. // Always return $prepared_args. return $prepared_args; }, 10, 2 );
Changelog #
Version | Description |
---|---|
2.5.8 | Introduced. |