Skip to content

Commit

Permalink
Merge tag '2.2.1' into develop
Browse files Browse the repository at this point in the history
v2.2.1
  • Loading branch information
titouanmathis committed Mar 28, 2024
2 parents a4f59ca + ee74fb9 commit 35cab82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## v2.2.1 - 2024.03.28

### Fixed

- Allow passing custom options to `sentry_init()` ([a2641db](https://github.com/studiometa/wp-toolkit/commit/a2641db))

## v2.2.0 - 2024.03.28

### Added
Expand Down
7 changes: 4 additions & 3 deletions src/Sentry/Sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class Sentry
{
public static function configureWithDefaults(string $root_dir): void
public static function configureWithDefaults(string $root_dir, array $options = []): void
{
$release = '';

Expand All @@ -37,12 +37,13 @@ public static function configureWithDefaults(string $root_dir): void
traces_sample_rate: $traces_sample_rate,
profiles_sample_rate: $profiles_sample_rate,
),
$options
);
}

private static function configure(Config $config): void
private static function configure(Config $config, array $options = []): void
{
init_sentry($config->toArray());
init_sentry($config->toArray() + $options);

early_add_action('init', function () use ($config) {
wp_enqueue_script('sentry-loader-script', $config->js_loader_script, []);
Expand Down

0 comments on commit 35cab82

Please sign in to comment.