Filter
rpress_api_fooditem_logs
On this page
Filters the complete fooditem logs response returned by the API.
Runs at the end of RPRESS_API::get_fooditem_logs() after every log entry has been passed through rpress_api_fooditem_log_item. The array is keyed by 'fooditem_logs'.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$fooditems | array | Response data with the log entries under 'fooditem_logs'. |
$this | RPRESS_API | The API instance handling the request. |
Return value#
array. The logs response.
Example#
function my_api_fooditem_logs( $fooditems, $api ) {
$fooditems['log_count'] = isset( $fooditems['fooditem_logs'] ) ? count( $fooditems['fooditem_logs'] ) : 0;
return $fooditems;
}
add_filter( 'rpress_api_fooditem_logs', 'my_api_fooditem_logs', 10, 2 );
Notes#
Not applied when no logs are found; an error array is returned instead.
Source#
Applied in:
includes/api/class-rpress-api.php(line 1372), inRPRESS_API::get_fooditem_logs()
See also#
Was this page helpful?
