I'd say because of the classes boundaries. It must only be replaces if it is found at the start of the string, at the end of the string, or surrounded by whitespace. If you str_replace the class, you might end up replacing parts of other classes (if you don't include spaces in your search), or you might miss those at the start or end (if you do include spaces). Hm. Maybe `str_replace( " {$class} ", '', " {$options['class']} ")`?

Also, I think the current code produces additional whitespace within `$options['class']`. `one_two_three` would become `one___three` if `two` was removed, right?