You are here

public function InstapageCmsPluginDrupal8Connector::isHtmlReplaceNecessary in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/connectors/InstapageCmsPluginDrupal8Connector.php \InstapageCmsPluginDrupal8Connector::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/InstapageCmsPluginDrupal8Connector.php, line 716

Class

InstapageCmsPluginDrupal8Connector
Class that utilizes native Drupal 8 functions to perform actions like remote requests and DB operations.

Code

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