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

Properly maps fields that are missing from the post meta data to names, that are similar to those of the post meta.
См. также: parse_fields_from_content for how the input data is generated.
public map_parsed_field_contents_of_post_to_field_names ( array $parsed_post_content ) : array
$parsed_post_content array Parsed post content
Результат array Mapped fields.
 /**
  * Test map_parsed_field_contents_of_post_to_field_names
  *
  * @group csvexport
  */
 public function test_map_parsed_field_contents_of_post_to_field_names()
 {
     $input_data = array('test_field' => 'moonstruck', '_feedback_subject' => 'This is my form', '_feedback_author_email' => '', '_feedback_author' => 'John Smith', '_feedback_author_url' => 'http://example.com', '_feedback_main_comment' => 'This is my comment!', 'another_field' => 'thunderstruck');
     $plugin = new Grunion_Contact_Form_Plugin();
     $result = $plugin->map_parsed_field_contents_of_post_to_field_names($input_data);
     $expected_result = array('Contact Form' => 'This is my form', '1_Name' => 'John Smith', '3_Website' => 'http://example.com', '4_Comment' => 'This is my comment!');
     $this->assertEquals($expected_result, $result);
 }