Custom Sensor Help
-
Hi,
I have used the docs and sample plugin provided on your site in hope to set up a custom event sensor.
I want to have the logic contained in my theme so am using the ‘wsal_custom_sensors_classes_dirs’ hook to change the path for the sensor. However, I can’t seem to get this hook to fire??
The Sensor class lives at /wp-content/my-theme/src/ce-wp-activity-log/custom-sensors
The filter in my functions.php file is as follows:
add_filter( ‘wsal_custom_sensors_classes_dirs’, ‘add_custom_sensors_path’ );
function add_custom_sensors_path($paths = []): array {
$paths = ( is_array( $paths ) ) ? $paths : array();
$paths[] = trailingslashit( trailingslashit( get_stylesheet_directory() ) . ‘src’ . DIRECTORY_SEPARATOR . ‘ce-wp-activity-log’ . DIRECTORY_SEPARATOR . ‘custom-sensors’ );
return $paths;
}I am also using the Gravity forms extension and can see that it uses the same hook. When I var_dump() out the $paths variable in the SensorManager.php (where the filter is run), the Gravity forms path is there, but mine isn’t.
Just wondering if you might know what the issue is here? Any assistance would be much appreciated. Thanks
*** Update ***
After some additional investigation I have found that my hook is being included, but only on the front end of the site. I am wanting to capture some admin events… is this possible? Thanks
- The topic ‘Custom Sensor Help’ is closed to new replies.