Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2019-12-02 21:01:01 +0300
committerGitHub <noreply@github.com>2019-12-02 21:01:01 +0300
commitfb0a8769499fc04dc23ae77c859c249d08b4eb35 (patch)
tree1e1457855e47c627e2f92cd437aa32c200944339 /core/SettingsServer.php
parent54dadb98beae46f88203df273d1bada6a2596b5b (diff)
Add method to detect if we are running within Matomo for WordPress (#15213)
Diffstat (limited to 'core/SettingsServer.php')
-rw-r--r--core/SettingsServer.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/SettingsServer.php b/core/SettingsServer.php
index 1b35efc8f1..8970e38549 100644
--- a/core/SettingsServer.php
+++ b/core/SettingsServer.php
@@ -57,6 +57,17 @@ class SettingsServer
}
/**
+ * Returns true if Matomo is running within Matomo for WordPress.
+ *
+ * @return bool true if Matomo is running in WordPress, false if Matomo is running as part of On-Premise
+ * @api
+ */
+ public static function isMatomoForWordPress()
+ {
+ return defined( 'ABSPATH') && function_exists('\add_action');
+ }
+
+ /**
* Returns `true` if running on Microsoft IIS 7 (or above), `false` if otherwise.
*
* @return bool