From 836ece2db95a70cfaf5af9114a4c0bb303ca9077 Mon Sep 17 00:00:00 2001 From: JJ Date: Mon, 19 Aug 2024 15:20:26 -0400 Subject: [PATCH 1/2] add documentation to log data filter --- classes/class-connector.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/class-connector.php b/classes/class-connector.php index 066baf9e3..af79467d5 100644 --- a/classes/class-connector.php +++ b/classes/class-connector.php @@ -158,6 +158,12 @@ public function action_links( $links, $record ) { public function log( $message, $args, $object_id, $context, $action, $user_id = null ) { $connector = $this->name; + /** + * Override the data logged. Returning false to this filter will stop the data from being logged. + * Examples of this filter in use can be found in some of the custom connectors. + * + * @return array|false An array of the data to be logged or false if it should not be logged. + */ $data = apply_filters( 'wp_stream_log_data', compact( 'connector', 'message', 'args', 'object_id', 'context', 'action', 'user_id' ) From bbd0f25a4a42aad6f0784eb5aad2bd6662e40735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Krzemi=C5=84ski?= Date: Fri, 4 Oct 2024 13:18:04 +0200 Subject: [PATCH 2/2] Add extra hint for devs Co-authored-by: Marco Pereirinha --- classes/class-connector.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/class-connector.php b/classes/class-connector.php index af79467d5..d36da3f3b 100644 --- a/classes/class-connector.php +++ b/classes/class-connector.php @@ -161,6 +161,7 @@ public function log( $message, $args, $object_id, $context, $action, $user_id = /** * Override the data logged. Returning false to this filter will stop the data from being logged. * Examples of this filter in use can be found in some of the custom connectors. + * @see Connector_ACF::log_override() * * @return array|false An array of the data to be logged or false if it should not be logged. */