You are here

public function InstapageCmsPluginWPConnector::isHtmlReplaceNecessary in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/connectors/InstapageCmsPluginWPConnector.php \InstapageCmsPluginWPConnector::isHtmlReplaceNecessary()

Checks if there is a need to replace content of CMS with a landing page. Prevents content replacement on admin/login pages.

Return value

bool True if replace is possible.

File

core/connectors/InstapageCmsPluginWPConnector.php, line 855

Class

InstapageCmsPluginWPConnector
Class that utilizes native WordPress functions to perform actions like remote requests and DB operations.

Code

public function isHtmlReplaceNecessary() {
  if (is_admin() || $this
    ->isLoginPage() || InstapageCmsPluginHelper::isCustomParamPresent()) {
    InstapageCmsPluginHelper::writeDiagnostics('is_admin || isLoginPage || isCustomParamPresent', 'HTML Replace is not necessary');
    return false;
  }
  return true;
}