Ukázka kódu 1853

1853

add_filter('gform_get_form_filter', function($body, $form) {
	global $webmaestro_gforms_scripts_tuning;
	$js = "";
	preg_match_all('#<script[^>]*>(.*?)</script>#is', $body, $matches);
	foreach ($matches[1] as $value) $js .= $value;
	$body = preg_replace('#<script[^>]*>(.*?)</script>#is', '', $body); 
	$webmaestro_gforms_scripts_tuning .= $js;
	return $body;
}, 10, 2);