Isn’t possible to filter the options
-
Shouldn’t this apply_filters be assigned to a variable?
if ( has_filter( 'wp_sentry_options' ) ) { apply_filters( 'wp_sentry_options', $this->get_client()->getClient()->getOptions() ); }
I’m trying to filter the $options but it is not reflecting my changes.
My code (according to https://github.com/stayallive/wp-sentry/blob/v4.0.1/README.md#wp_sentry_options-array):
add_filter( 'wp_sentry_options', 'sentry_excluded_list' ); function sentry_excluded_list( \Sentry\Options $options ) { $excluded_list = $options->getInAppExcludedPaths(); foreach ( $excluded_list as $key => $excluded ) { if ( stripos( $excluded, 'wp-admin' ) !== false or stripos( $excluded, 'wp-includes' ) !== false ) { unset( $excluded_list[ $key ] ); } } $options->setInAppExcludedPaths( $excluded_list ); return $options; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Isn’t possible to filter the options’ is closed to new replies.