Files
medicalalert-web-reloaded/wp/wp-content/themes/medicalalert/helpers/StringFormatter.php
Tony Volpe 706f089d5e add theme
2024-06-18 16:47:10 -04:00

41 lines
988 B
PHP

<?php
namespace Helpers;
class StringFormatter
{
public static function productTitle()
{
return function ($template, $context, $args, $source) {
$productTitle = $context->get($args);
$parts = explode("(", $productTitle);
return trim($parts[0]);
};
}
public static function adminOrderLabel()
{
return function ($template, $context, $args, $source) {
$label = $context->get($args);
if (substr($label, 0, 21) === "Select if this person") {
return "Caretaker is authorized";
}
if ($label === "SESSpromoid") {
return "Promotion ID";
}
if ($label === "SESSpromotion_description") {
return "Promotion Description";
}
if ($label === "SESScoupon_code") {
return "Coupon Code";
}
return $label;
};
}
}