From http://es2.php.net/manual/en/functions.user-defined.php:
All functions and classes in PHP have the global scope - they can be called outside a function even if they were defined inside and vice versa.
PHP does not support function overloading, nor is it possible to undefine or redefine previously-declared functions.
function ov3rfly_replace_include_blank
is being declared every time you call my_wpcf7_form_elements
, and PHP does not support function overloading, hence the error. Since all PHP functions have global scope, they can be called inside a function even if they where defined outside. Try:
function ov3rfly_replace_include_blank($name, $text, &$html) {
$matches = false;
preg_match('/<select name="' . $name . '"[^>]*>(.*)<\/select>/iU', $html, $matches);
if ($matches) {
$select = str_replace('<option value="">---</option>', '<option value="">' . $text . '</option>', $matches[0]);
$html = preg_replace('/<select name="' . $name . '"[^>]*>(.*)<\/select>/iU', $select, $html);
}
}
function my_wpcf7_form_elements($html) {
ov3rfly_replace_include_blank('c_age', 'גיל', $html);
ov3rfly_replace_include_blank('c_area', 'איזור', $html);
ov3rfly_replace_include_blank('c_type', 'סוג ביטוח', $html);
ov3rfly_replace_include_blank('c_area', 'איזור', $html);
ov3rfly_replace_include_blank('c_cartype', 'סוג רכב', $html);
ov3rfly_replace_include_blank('c_manifacture', 'יצרן', $html);
ov3rfly_replace_include_blank('c_manifactureyear', 'שנת יצור', $html);
ov3rfly_replace_include_blank('c_driversage', 'גיל הנהג', $html);
ov3rfly_replace_include_blank('c_prevent', 'שלילות', $html);
ov3rfly_replace_include_blank('c_claim', 'תביעות', $html);
return $html;
}
add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements');