Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit ba60ff2

Browse files
authored
Merge pull request #1 from BeAPI/feature/filter-trackers
add filter to select which trackers are loaded by the plugin
2 parents d0e1f0e + acaeec8 commit ba60ff2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/main.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,22 @@ public function register() {
1717
return;
1818
}
1919

20-
$classes = [
21-
JS::class,
22-
PHP::class,
20+
$trackers = [
21+
'js' => JS::class,
22+
'php' => PHP::class,
2323
];
2424

25-
foreach ( $classes as $class ) {
25+
/**
26+
* Filters the trackers loaded by the plugin.
27+
*
28+
* @param array $trackers List of trackers.
29+
*
30+
* @since 1.0.1
31+
*
32+
*/
33+
$trackers = apply_filters( 'beapi_raygun_trackers', $trackers );
34+
35+
foreach ( $trackers as $class ) {
2636
$cclass = new $class();
2737
$interfaces = class_implements( $cclass );
2838

0 commit comments

Comments
 (0)