0 &&
count(array_filter($inputArr, function($item){return $item > 0;})) > 1 ){
$inputArr[3] += $inputArr[2] * 7;
$inputArr[2] = 0;
}
foreach($inputArr as $i => $t){
if($i > 3 && $tIsAbsent){
$output .= 'T';
$tIsAbsent = false;
}
if($t > 0){
$output .= round($t) . $unitLetters[$i]; //decimal values for time aren't recognized
}
}
return $output;
}
function ub_convert_to_paragraphs($string){
if($string === ''){
return '';
}
else{
$string = explode('
', $string);
$string = array_map(function($p){return '
' . $p . '
';}, $string); return implode('', $string); } } function ub_render_how_to_block($attributes){ extract($attributes); $header = ''; $timeUnits = ["second", "minute", "hour", "day", "week", "month", "year"]; $suppliesCode = '"supply": ['; if($advancedMode && $includeSuppliesList){ $header .= '<' . $secondLevelTag . '>' . $suppliesIntro . '' . $secondLevelTag . '>'; if(isset($supplies) && count($supplies) > 0){ $header .= $suppliesListStyle === 'ordered' ? '' . $totalTimeText . $totalTimeDisplay . '
' . $costDisplayText . $costDisplay . '
' . $timeDisplay : '') . $stepsDisplay . '