• Fatal error: Cannot redeclare help4cms_replace_include_blank() (previously declared in /home2/somitra/public_html/[site]/truck/wp-content/themes/inovado/functions.php:381) in /home2/somitra/public_html/[site]/truck/wp-content/themes/inovado/functions.php on line 381.

    Please help me

    function help4cms_wpcf7_form_elements($html)
    
     {
    
     function help4cms_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);
    
     }
    
     }
    
     
    
     help4cms_replace_include_blank('ContactState', '--state--', $html); // Chnage here your dropdown menu ID
    
     help4cms_replace_include_blank('ShipmentState', '--state--', $html); // Chnage here your dropdown menu ID
    
     help4cms_replace_include_blank('Shipment2State', '--state--', $html); // Chnage here your dropdown menu ID
    
     return $html;
    
     }
    
     
    
    add_filter('wpcf7_form_elements', 'help4cms_wpcf7_form_elements');

The topic ‘Fatal error: cannot redeclare function’ is closed to new replies.