{"id":5190530,"date":"2014-08-14T14:05:34","date_gmt":"2014-08-14T14:05:34","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/renderdirectionsarray\/"},"modified":"2016-08-22T00:28:44","modified_gmt":"2016-08-22T00:28:44","slug":"renderdirectionsarray","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/renderdirectionsarray\/","title":{"rendered":"Change to the renderDirectionsArray"},"content":{"rendered":"<p>Hi guys,<\/p>\n<p>just wanted to suggest a change to the renderDirectionsArray function to render the directions one after the other one in the structured data instead of a block. Here is the modified code that I added the <strong>itemprop=\\&#8221;recipeInstructions\\&#8221;<\/strong> in the &lt;$tag&gt;. The code now read like:<\/p>\n<pre><code>public function renderDirectionsArray(array $array, $tag = &#039;li&#039;)\n\t{\n\t\t$value = 1;\n\n\t\tforeach ($array as $item)\n\t\t{\n\t\t\tif (substr($item, 0, 1) === &quot;:&quot;)\n\t\t\t{\n\t\t\t\techo &quot;&lt;$tag class=\\&quot;kb-section-header\\&quot; itemprop=\\&quot;recipeInstructions\\&quot;&gt;&quot; . substr($item, 1) . &quot;&lt;\/$tag&gt;\\r\\n&quot;;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo &quot;&lt;$tag itemprop=\\&quot;recipeInstructions\\&quot; value=\\&quot;$value\\&quot;&gt;&quot; . $item . &quot;&lt;\/$tag&gt;\\r\\n&quot;;\n\t\t\t\t$value += 1;\n\t\t\t}\n\t\t}\n\t}<\/code><\/pre>\n<p>Just thought I should let you know. May you can considered i to the next upgrade.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/kitchenbug\/<\/p>\n","protected":false},"template":"","class_list":["post-5190530","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5190530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5190530\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5190530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}