public function embed_extend()
{
if ($this->EE->TMPL->tagdata) {
$embed_vars = array();
foreach ($this->EE->TMPL->var_pair as $key => $val) {
if (strncmp($key, 'stash:', 6) == 0) {
$pattern = '/' . LD . $key . RD . '(.*)' . LD . '\\/' . $key . RD . '/Usi';
preg_match($pattern, $this->EE->TMPL->tagdata, $matches);
if (!empty($matches)) {
$embed_vars[$key] = $matches[1];
}
}
}
if (is_array($this->EE->TMPL->tagparams)) {
$this->EE->TMPL->tagparams = array_merge($embed_vars, $this->EE->TMPL->tagparams);
} else {
$this->EE->TMPL->tagparams = $embed_vars;
}
$this->EE->TMPL->tagdata = '';
}
return $this->embed();
}