/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/src/Form
Edit: /var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/src/Form/Templates.php (2536B)
templates = apply_filters(
'give_register_form_template',
[
'sequoia' => Sequoia::class,
'classic' => Classic::class,
'legacy' => Legacy::class,
]
);
}
/**
* Get Registered templates
*
* @since 2.7.0
* @return Template[]
*/
public function getTemplates()
{
// Check if all templates have there object or not.
$remainingObjs = array_diff(array_keys($this->templates), array_keys($this->templateObjs));
// Get object if any remaining
if ($remainingObjs) {
foreach ($remainingObjs as $templateId) {
$this->templateObjs[$templateId] = $this->getTemplateObject($templateId);
}
}
return $this->templateObjs;
}
/**
* Get Registered form template
*
* @since 2.7.0
*
* @param string $templateId Template Id. Default to active form template.
*
* @return Template
*/
public function getTemplate($templateId = null)
{
$templateId = $templateId ?: FormTemplateUtils::getActiveID();
if (isset($this->templateObjs[$templateId])) {
return $this->templateObjs[$templateId];
}
$this->templateObjs[$templateId] = $this->getTemplateObject($templateId);
return $this->getTemplateObject($templateId);
}
/**
* Get class object.
*
* @since 2.7.0
*
* @param string $templateId
*
* @return Template
*/
private function getTemplateObject($templateId)
{
return new $this->templates[$templateId]();
}
}