/** * @param $placeholders * @return array */ public function filterPlaceholders(array $placeholders) { $filters = $this->_pm->getBootstrap()->getOptionsManager()->getOption('placeholders_filters'); if (!empty($filters)) { $counter = 0; foreach (preg_split("/((\r?\n)|(\r\n?))/", $filters) as $filter) { if (!$this->_pm->isPremium() && $counter >= 1) { break; } preg_match_all('/\\[([A-Za-z0-9_-]+?)\\]/', $filter, $match); if (isset($match[0][0]) && isset($match[1][0])) { $placeholder_tag = $match[0][0]; $placeholder_name = $match[1][0]; if (isset($placeholders[$placeholder_name])) { $filter_string = str_replace($placeholder_tag, '"' . $placeholders[$placeholder_name] . '"', $filter); if (!empty($filter_string)) { if ($filter_string[0] != '{') { $filter_string = '{{ ' . $filter_string . ' }}'; } $placeholders[$placeholder_name] = IfwPsn_Wp_Tpl::renderString($filter_string); } } } $counter++; } } return $placeholders; }