Filter
rpress_api_fooditem_log_item
On this page
Filters a single menu item download log entry in the fooditem logs API response.
Runs inside the loop in RPRESS_API::get_fooditem_logs() for each log post. The item array contains ID, user_id, product_id, product_name, customer_id, payment_id, ip and date. Add keys here to expose more of the log's post data or meta.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$item | array | The log entry as it will appear in the response. |
$log | WP_Post | The log post the entry was built from. |
$log_meta | array | All post meta for the log post, from get_post_custom(). |
Return value#
array. The log entry to include in the response.
Example#
function my_api_log_item( $item, $log, $log_meta ) {
$item['date_gmt'] = $log->post_date_gmt;
return $item;
}
add_filter( 'rpress_api_fooditem_log_item', 'my_api_log_item', 10, 3 );
Source#
Applied in:
includes/api/class-rpress-api.php(line 1369), inRPRESS_API::get_fooditem_logs()
See also#
Was this page helpful?
