You must be defining your callback function inside a function that is reused by the widget system-- my guess is inside the widget
method.
Define the callback outside the widget itself, and only apply (apply_filter
) inside the widget.
Without seeing your code in context that is the best I've got.