Filter
rpress_api_customers
On this page
Filters the customers data returned by the customers API endpoint.
Runs at the end of a customers request when customers were found. The array has a customers key holding a list of customer data arrays, or a single customer when one was requested. Error responses are returned before the filter runs.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$customers | array | API response data containing the customers list. |
$api | RPRESS_API | The API object handling the request. |
Return value#
array. The customers response data.
Example#
function my_api_customers( $customers, $api ) {
$customers['generated_by'] = 'my-plugin';
return $customers;
}
add_filter( 'rpress_api_customers', 'my_api_customers', 10, 2 );
Notes#
Fired from the base API class and the v2 class with the same signature.
Source#
Applied in:
includes/api/class-rpress-api-v2.php(line 249), inRPRESS_API_V2::get_customers()includes/api/class-rpress-api.php(line 837), inRPRESS_API::get_customers()
See also#
Was this page helpful?
