Title: Missing argument 3
Last modified: August 21, 2016

---

# Missing argument 3

 *  [awshout](https://wordpress.org/support/users/awshout/)
 * (@awshout)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/missing-argument-3-4/)
 * Getting Warning: Missing argument 3 for Nav_Menu_Images::register_menu_item_filter()
   on line 268 in debug mode.
 * To resolve this I simply set $args = ”
 * public function register_menu_item_filter( $item_classes, $item, $args = ” )
 * [http://wordpress.org/plugins/nav-menu-images/](http://wordpress.org/plugins/nav-menu-images/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Milan Dinić](https://wordpress.org/support/users/dimadin/)
 * (@dimadin)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/missing-argument-3-4/#post-3987000)
 * Although several people reported this, I have never reproduced it and see no 
   reason why it happens, so I need to look at exact place where this is happening
   to try to figure out.
 *  [Farrah99](https://wordpress.org/support/users/farrah99/)
 * (@farrah99)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/missing-argument-3-4/#post-3987084)
 * Awshout, thanks that works!!
 *  [davidcasey](https://wordpress.org/support/users/davidcasey/)
 * (@davidcasey)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/missing-argument-3-4/#post-3987131)
 * [@milan](https://wordpress.org/support/users/milan/) Dinić
 * The problem is that nav_menu_css_class takes only two arguments:
    [http://codex.wordpress.org/Plugin_API/Filter_Reference/nav_menu_css_class](http://codex.wordpress.org/Plugin_API/Filter_Reference/nav_menu_css_class)
   So, any plugin/theme using that filter will naturally only supply two arguments.
   Setting $args=” allows a default value if one is not provided, but it appears
   that you don’t use them.
 * You could either use [@awshout](https://wordpress.org/support/users/awshout/)
   fix or change the following in /wp-content/plugins/nav-menu-images/nav-menu-images.
   php
    **line 98** **from:** `add_filter( 'nav_menu_css_class', array( &$this, '
   register_menu_item_filter' ), 15, 3 );` **to:** `add_filter( 'nav_menu_css_class',
   array( &$this, 'register_menu_item_filter' ), 15, 2 );`
 * **line 268**
    **from:** `public function register_menu_item_filter( $item_classes,
   $item, $args ) {` **to:** `public function register_menu_item_filter( $item_classes,
   $item ) {`
 *  Plugin Author [Milan Dinić](https://wordpress.org/support/users/dimadin/)
 * (@dimadin)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/missing-argument-3-4/#post-3987141)
 * [@davidcasey](https://wordpress.org/support/users/davidcasey/)
 * `nav_menu_css_class` accepts three parameters, see [source code](https://core.trac.wordpress.org/browser/tags/3.8/src/wp-includes/nav-menu-template.php#L99).
   It accepted three parameters since WP 3.1, only in WP 3.0, when this filter was
   introduced, it accepted just two parameters but that version was never supported
   by this plugin.
 * In version 3.2 I added `array()` as default value of third parameter so will 
   see if that will fix this issue which I believe wasn’t caused by me.
 *  [davidcasey](https://wordpress.org/support/users/davidcasey/)
 * (@davidcasey)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/missing-argument-3-4/#post-3987142)
 * [@milan](https://wordpress.org/support/users/milan/) Dinić
    It appears the WP
   published Codex does not coincide with their source code. Thank you for making
   things work regardless of fault. Thanks for the great plugin.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Missing argument 3’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/nav-menu-images.svg)
 * [Nav Menu Images](https://wordpress.org/plugins/nav-menu-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nav-menu-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nav-menu-images/)
 * [Active Topics](https://wordpress.org/support/plugin/nav-menu-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nav-menu-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nav-menu-images/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [davidcasey](https://wordpress.org/support/users/davidcasey/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/missing-argument-3-4/#post-3987142)
 * Status: not resolved