Controlling Logtivity Settings With Code

It is possible to use filters to control the Logtivity plugin and how it connects to the Logtivity app. This allows you to use code to manage Logtivity’s settings on one or multiple sites.

These filters can be placed in your theme’s functions.php file or you can add them with a custom plugin.

This filter allows you to add your Logtivity API key:

add_filter('logtivity_site_api_key', function() {
	return '';
});

These next filters allow you to modify the settings inside the Logtivity plugin. Choose true or false to either enable or disable each setting.

add_filter('logtivity_disable_default_logging', function() {
	return false;
});

add_filter('logtivity_should_store_user_id', function() {
	return true;
});

add_filter('logtivity_should_store_ip', function() {
	return true;
});

add_filter('logtivity_should_log_profile_link', function() {
	return true;
});

add_filter('logtivity_should_log_username', function() {
	return true;
});

add_filter('logtivity_enable_debug_mode', function() {
	return false;
});