Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8837247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:40:33+00:00 2026-06-14T09:40:33+00:00

this is the url to the test site – http://gil.beastserv.com/hava/ i have this function,

  • 0

this is the url to the test site – http://gil.beastserv.com/hava/

i have this function, with some help from here

function my_wpcf7_form_elements($html) {
    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);
        }
    }
    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');

its working great when there is only 1 form, but when im tring to place 2 forms in 1 page, im getting the Fatal error: Cannot redeclare ov3rfly_replace_include_blank() (previously declared

i tried to place the if (!function_exists('formatStr')) {}
as so:

if (!function_exists('formatStr')) {
function my_wpcf7_form_elements($html) {}
add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements');
}

but i guess that its not the problem.. the function is called twice, because there are 2 forms.. how can i overcome this?

Thanks alot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:40:34+00:00Added an answer on June 14, 2026 at 9:40 am

    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');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
Let say that i have this to url's site.com/hello-world/test.html site.com/hello-world/test/test.html if i go to
Let's say I have this url: www.example.com/test.php?page=4 How do i retrieve the value of
Test Page URL: http://www.guygar.com/inception/ultra/indexCopy.html I am new to this and searching SO I found
I want show weather information from xml to this URL: http://www.google.com/ig/api?weather=roma&hl=it using this script:
On this site: http://www.seleconlight.com everything is fine On this url: http://www.seleconlight.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=shop.flypage.p3&category_id=8&product_id=21 most people get
Given that i have the following url in my site: http://localhost/test/example.php?a=1&b=2 How can i
do you test this url in your application that writted with cakephp ? www.yourCakephpApp.com/test
Could someone tell me if this: $.ajax({ url: 'test.html', success: function(data) { alert(Data Loaded:
I have this URL example.com/photo?people I want to rewrite this URL in the form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.