Custom importer – inline html tags cause new paragraph
-
I’m trying to import recipes but having difficulty with the instructions. Inline html tags li <a>, <strong>, or <em> cause a new paragraph.
For example, “Thoroughly combine all the ingredients in a small bowl”
becomes:
“Thoroughly combine
all the ingredients in a small bowl.”
My code is below. I would appreciate any insight or guidance.
$acf_instructions = get_post_meta( $id, 'directions_sections_1_direction_list', true ); preg_match_all( '!<li>(.*?)</li>!', $acf_instructions, $instruction_matches ); foreach ( $instruction_matches[1] as $instruction_match ) { $instruction_match = trim( $this->derichify( $instruction_match ) ); $group['instructions'][] = array( 'text' => $instruction_match, ); } $instructions[] = $group; $recipe['instructions'] = $instructions;
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom importer – inline html tags cause new paragraph’ is closed to new replies.