“Missing argument 2” on a custom function
-
I’m using this function to add a class to the category links in the loop:
add_filter('the_category','add_class_to_category',10,3); function add_class_to_category( $thelist, $separator, $parents){ $class_to_add = 'cat'; return str_replace('<a href="', '<a class="' . $class_to_add . '" href="', $thelist); }
But when I go to create a new (or edit) a post, I get this message on the categories box, above the categories list:
Warning: Missing argument 2 for add_class_to_category() in …/public_html/wp-content/themes/tema12/functions.php on line 186.
Line 186 is:
function add_class_to_category( $thelist, $separator, $parents){
What argument am I missing?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘“Missing argument 2” on a custom function’ is closed to new replies.