Closed Kilbourne closed 4 months ago
I'm assuming with "filter integrations setting" you mean before_send
?
See: https://github.com/stayallive/wp-sentry?tab=readme-ov-file#wp_sentry_before_send
Otherwise please let me know what specifically you want to do (maybe provide a code example) so I can better help you!
The filter i wanted add was
public function get_default_options(): array {
[...]
return apply_filters( 'wp_sentry_default_options', $options, $this);
}
And then modify the integrations
key
But now I checked and I can use WP_SENTRY_CLIENTBUILDER_CALLBACK
function wp_sentry_clientbuilder_callback($clientBuilder){
$options = $clientBuilder->getOptions();
$integrations = $options->getIntegrations();
[...]
$options->setIntegrations($integrations);
}
define( 'WP_SENTRY_CLIENTBUILDER_CALLBACK', 'wp_sentry_clientbuilder_callback');
Not sure if you want add that filter anyway ( it could be useful)
If this works for you I think this is enough 👍
I am wondering though what integrations you are removing or adding!
I'm using Roots Acorn ( although with a custom ErrorHandler), so I filter the default error/exception/shutdown handlers and add LogIntegration feature from Laravel package. ( I don't like too much the callable constant and I would have prefered to use a filter, but suppose it is necessary for who is loading the library before add_filter is available)
Yeah it's tricky, but there is a solution even if it's not pretty 😉
Hi, could you pleasea add that filter? i need to customize on first instantiation ( namely filter integrations setting)