From f8430463f6b3e9269bfc04bbf1f5a6040471105f Mon Sep 17 00:00:00 2001 From: Glauber Silva Date: Fri, 31 May 2024 09:53:30 -0300 Subject: [PATCH] Feature: add log source filter (#7386) --- src/API/Endpoints/Logs/GetLogs.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/API/Endpoints/Logs/GetLogs.php b/src/API/Endpoints/Logs/GetLogs.php index 28d8811492..3c6df0e870 100644 --- a/src/API/Endpoints/Logs/GetLogs.php +++ b/src/API/Endpoints/Logs/GetLogs.php @@ -142,6 +142,8 @@ public function getSchema() } /** + * @unreleased Add 'givewp_log_source_view' filter + * * @param WP_REST_Request $request * * @return WP_REST_Response @@ -157,7 +159,8 @@ public function handleRequest(WP_REST_Request $request) 'id' => $log->getId(), 'log_type' => $log->getType(), 'category' => $log->getCategory(), - 'source' => $log->getSource(), + 'source' => apply_filters('givewp_log_source_view', $log->getSource(), $log->getContext(), + $log->getId()), 'message' => $log->getMessage(), 'context' => $log->getContext(), 'date' => $log->getDate(),