Categories
CMS Mastering Development Wordpress

ArgumentCountError caused by wp-includes/class-wp-hook.php

when we give $depth in argument of nav_menu_css_class it gives me argument error. Here is my code: add_filter( ‘nav_menu_css_class’ , ‘eodwp_menu_item_class’,10 ,3 ); function eodwp_menu_item_class( $classes, $item, $args, $depth) { print_r($depth); if ($depth == 0) { $classes= array(‘dropdown’); print_r($classes); } else { $classes= array(‘dropdown-item’); } return $classes; } Fatal error: Uncaught ArgumentCountError: Too few arguments […]