Hi!
I don’t have a snippet for you to just copy and paste over unfortunately but we do have documentation on how to exclude errors from specific parts, this can be easily adjusted to exclude errors from the /wp-admin/.
> https://github.com/stayallive/wp-sentry#capturing-errors-only-from-certain-theme-andor-plugin
Take a look to see if you can use that to do what you want!
`Hi!
I don’t have a snippet for you to just copy and paste over unfortunately but we do have documentation on how to exclude errors from specific parts, this can be easily adjusted to exclude errors from the /wp-admin/.
> https://github.com/stayallive/wp-sentry#capturing-errors-only-from-certain-theme-andor-plugin
Take a look to see if you can use that to do what you want!`
Hello Alex
Thanks for your reply. I already use this filter, but I’m not sure how to modify it for wp-admin. Could you please help me?
I think replacing this in the snippet from the readme:
if ( $strContainsHelper( $frame->getFile(), 'themes/THEME_NAME' )
|| $strContainsHelper( $frame->getFile(), 'plugins/PLUGIN_NAME' )
) {
with:
if ( $strContainsHelper( $frame->getFile(), 'wp-admin/' ) ) {
might already work, but do be mindful that this excludes any error that comes through wp-admin so also when your code is called from wp-admin it basically looks if the frames (lines of the stacktrace) contains a file from wp-admin and then doesn’t report it. I might be better to simply mark the exceptions you see from the wp-admin as ignored in the Sentry interface or be more specific about which you are filtering because this might filter out too many exceptions.
So use at your own risk! 🙂
-
This reply was modified 4 years, 4 months ago by
stayallive. Reason: formatting