Skip to content

Commit

Permalink
Move wp_sentry_hook lower
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Jan 3, 2024
1 parent 4c50a71 commit ad28d94
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions public/wp-sentry-browser.wp.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@
}
}

if (typeof wp_sentry_hook === 'function') {
var hookResult = wp_sentry_hook(wp_sentry);

// If the hook returns false we do not continue to initialize Sentry
if (hookResult === false) {
return;
}
}

wp_sentry.integrations = [];

// Enable replay if a sample rate is set
Expand All @@ -47,6 +38,16 @@
wp_sentry.integrations.push(new Sentry.Integrations.BrowserTracing(wp_sentry.wpBrowserTracingOptions));
}

// If the hook is defined we call it with the Sentry object so that the user can modify it
if (typeof wp_sentry_hook === 'function') {
var hookResult = wp_sentry_hook(wp_sentry);

// If the hook returns false we do not continue to initialize Sentry
if (hookResult === false) {
return;
}
}

Sentry.init(wp_sentry);

if (typeof wp_sentry.context === 'object') {
Expand Down

0 comments on commit ad28d94

Please sign in to comment.