replace_tokens_with_input() публичный Метод

Replaces tokens like {city} or {City} (case insensitive) with the value of an input field of that name
public replace_tokens_with_input ( string $subject, array $field_values ) : string
$subject string
$field_values array Array with field label => field value associations
Результат string The filtered $subject with the tokens replaced
 /**
  * @author tonykova
  * @covers Grunion_Contact_Form_Plugin::replace_tokens_with_input
  */
 public function test_token_with_curly_brackets_can_be_replaced()
 {
     $plugin = new Grunion_Contact_Form_Plugin();
     $subject = '{subject {token}}';
     $field_values = array('Subject {Token}' => 'Chicago');
     $this->assertEquals('Chicago', $plugin->replace_tokens_with_input($subject, $field_values));
 }