• Resolved andresva700

    (@andresva700)


    Hi,

    Thanks for this great plugin.

    I am trying to hook into the before_sent to filter events. I tried the following but it didn’t work:

    
    function customize_sentry_options($options)
    {
       
        $options['before_send'] = function ($event) {
            return $event;
        };
        return $options;
    }
    
    add_filter('wp_sentry_options', 'customize_sentry_options');
    

    I get the this error: Cannot access protected property Raven_Client::$error_types

    Thanks

    • This topic was modified 5 years, 2 months ago by andresva700.
Viewing 1 replies (of 1 total)
  • Plugin Author stayallive

    (@stayallive)

    Hi @andresva700,

    Sorry about the late reaction, but I was trying to get version 3.0 out of the door.

    There the problem is fixed. However slightly changed syntax is needed:

    
    function customize_sentry_options( \Sentry\Options $options ) {
        $options->setBeforeSendCallback(function (\Sentry\Event $event) {
            return $event;
        });
    }
    add_filter( 'wp_sentry_options', 'customize_sentry_options' );
    

    Please let me know if this worked for you!

Viewing 1 replies (of 1 total)
  • The topic ‘before_send hook’ is closed to new replies.