• Hi guys,

    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 itemprop=\”recipeInstructions\” in the <$tag>. The code now read like:

    public function renderDirectionsArray(array $array, $tag = 'li')
    	{
    		$value = 1;
    
    		foreach ($array as $item)
    		{
    			if (substr($item, 0, 1) === ":")
    			{
    				echo "<$tag class=\"kb-section-header\" itemprop=\"recipeInstructions\">" . substr($item, 1) . "</$tag>\r\n";
    			}
    			else
    			{
    				echo "<$tag itemprop=\"recipeInstructions\" value=\"$value\">" . $item . "</$tag>\r\n";
    				$value += 1;
    			}
    		}
    	}

    Just thought I should let you know. May you can considered i to the next upgrade.

    https://wordpress.org/plugins/kitchenbug/

Viewing 1 replies (of 1 total)
  • Plugin Author kitchenbug

    (@kitchenbug)

    Hi User,

    We can certainly make the change. I’ll add it to the next version list.

    Kind Regards,

    Gilad

Viewing 1 replies (of 1 total)
  • The topic ‘Change to the renderDirectionsArray’ is closed to new replies.