Support

Account

Home Forums General Issues \"Translate\" checkbox values with string replace Reply To: \"Translate\" checkbox values with string replace

  • <?php
    $string = array("string-1","string-2","string-3","string-4" );
    $replace = array("new-string-1","new-string-2","new-string-3","new-string-4");
    $fieldname = get_field('fieldname', $term); // it is a meta-field for a taxonomy term
    $replaces = str_replace($string , $replace , $fieldname);
    
    foreach ($replaces as $wert)
    {
      echo $wert . ',';
    }
    ?>

    Sorry, that was not my day.