<?php

$url = str_replace("/&","/?",WP_SITEURL.preg_replace("/[&?]+wcts=.*/","",preg_replace("/[&?]+wctsf=.*/","",$_SERVER[REQUEST_URI])));
if (strpos($url,"?") !== FALSE) { $url .= "&"; } else { $url .= "?"; }


/* cache hack because of issue, see trac http://core.trac.wordpress.org/ticket/16541 */
ob_start();
get_search_form();
$out = ob_get_clean();

if ($text == 'sss') { $text = __('Search', 'wct'); }
if ($text != '') { $text = "<b>".$text.":</b>&nbsp;"; }

// Change the Form for our functionality

$out = str_replace(
		array("</form>","name=\"s\"","value=\"\"","<div class=\"search\">"),
		array("<input type=\"hidden\" value=\"".$felder."\" name=\"wctsf\" /></form>","name=\"wcts\" class=\"wct-search\"","value=\"".$_GET['wcts']."\"","<div class=\"search\">".$text),
		preg_replace("/action=\"(.*?)\"/","action=\"".$url."\"",$out)
	);

?>