diff --git a/inc/handler/class-post-handler.php b/inc/handler/class-post-handler.php index 161b01e0..fa2938ba 100644 --- a/inc/handler/class-post-handler.php +++ b/inc/handler/class-post-handler.php @@ -269,6 +269,16 @@ protected function insert_permitted( string $transient_key, array $log ): bool { return true; } + /** + * Allow unrestricted logging if filtered. + * + * @param bool $unrestricted_logging Whether to allow unrestricted logging. + * @param array $log Log arguments. + */ + if ( \apply_filters( 'ai_logger_unrestricted_logging', false, $log ) ) { + return true; + } + /** * The throttling transient has expired if get_transient returns false, * and a new insert should be permitted. @@ -277,9 +287,8 @@ protected function insert_permitted( string $transient_key, array $log ): bool { } /** - * Assign the terms associated with the new post, currently - * used to apply a Log Level (info, warning, error) and the - * custom context to a log + * Assign the terms associated with the new post, currently used to apply a + * Log Level (info, warning, error) and the custom context to a log * * @param int $new_post_id Post ID. * @param string $term Term name.