I've been using the nav_menu_css_class
filter in one of my plugins, implemented as:
add_filter( 'nav_menu_css_class', 'wbwcrf_nav_menu_css_class', 10, 3 );
function wbwcrf_nav_menu_css_class( $classes, $item, $args )
{
/* snip */
return $classes;
}
The filter clearly has 3 arguments in the code (source) yet someone using my plugin has told me they get the error Warning: Missing argument 3 for wbwcrf_nav_menu_css_class()
.
So I looked at the codex documentation on nav_menu_css_class
which has an example using 2 arguments, I changed my code to 2 arguments since I'm not actually using the $args argument and everything seems to be working fine.
But I'm still really stumped as to why the source has 3 arguments yet the codex has 2 and why I don't receive any error when using 3 arguments, yet someone using my plugin does. Anyone able to clear up my confusion here please?