Is it possible to modify a function in a helper via the plugin or theme component system?

I’d like to change it from:

function categoryStripe(color, classes) {
  var style = color ? "style='background-color: #" + color + ";'" : "";
  return "<span class='" + classes + "' " + style + "></span>";
}

to:

function categoryStripe(color, classes) {
  var style = color ? "style='border: 1px solid #" + color + ";'" : "";
  return "<span class='" + "my-class" + classes + "' " + style + "></span>";
}

So changing background colour to a border and adding a class.

What’s the best way to achieve this Justin?


I did read that, however IIRC it only covers the ability to overwrite templates (and widgets) with no mention of helpers, I think?

1 Like