user3161363
user3161363

Reputation: 43

How to check if wordpress W3 Total Cache plugin is active?

which is the main class for W3 Total Cache plugin? I need to detect if plugin active or not from functions.php file.

Upvotes: 0

Views: 834

Answers (1)

Nick Duncan
Nick Duncan

Reputation: 829

You can do this:

if ( defined( 'W3TC' ) ) {
  /* W3 Total Cache is active */
}

I would suggest that you use this within a hook though to avoid the possibility that your PHP file is processed before W3TC.

Upvotes: 2

Related Questions