Title: Error Warning: sprintf() [function.sprintf]
Last modified: August 21, 2016

---

# Error Warning: sprintf() [function.sprintf]

 *  [felixlvh](https://wordpress.org/support/users/felixlvh/)
 * (@felixlvh)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-warning-sprintf-functionsprintf/)
 * I am getting the error on my menu
 * Warning: sprintf() [function.sprintf]: Too few arguments in /home/awint/www/www/
   wp-includes/nav-menu-template.php on line 231
 * [http://goo.gl/6eRBIM](http://goo.gl/6eRBIM)
 * [http://wordpress.org/plugins/responsive-select-menu/](http://wordpress.org/plugins/responsive-select-menu/)

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

 *  Plugin Author [sevenspark](https://wordpress.org/support/users/sevenspark/)
 * (@sevenspark)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-warning-sprintf-functionsprintf/#post-4025673)
 * RSM doesn’t call that function, so I’m not sure how it might be causing that 
   warning. Are you using the latest version of WordPress?
 * If this is a production site, I’d recommend setting WP_DEBUG to false to stop
   the warning from being printed.
 *  Thread Starter [felixlvh](https://wordpress.org/support/users/felixlvh/)
 * (@felixlvh)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-warning-sprintf-functionsprintf/#post-4025674)
 * Hi it’s using latest version of wordpress and wp_debug is already set to false
   🙁
 *  [moldero](https://wordpress.org/support/users/moldero/)
 * (@moldero)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-warning-sprintf-functionsprintf/#post-4025798)
 * Im using woothemes canvas theme along with ubermenu and this Responsive Select
   Menu and i am getting the same error:
    `Warning: sprintf() [function.sprintf]:
   Too few arguments in /nfs/c01/h14/mnt/32365/domains/www.com/wp-includes/nav-menu-
   template.php on line 406`
 *  [b0s](https://wordpress.org/support/users/b0s/)
 * (@b0s)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-warning-sprintf-functionsprintf/#post-4025801)
 * > RSM doesn’t call that function, so I’m not sure how it might be causing that
   > warning. Are you using the latest version of WordPress?
   > If this is a production site, I’d recommend setting WP_DEBUG to false to stop
   > the warning from being printed.
 * Hi sevenspark! I’m try to explain. So, I meet this problem, when i change permalinks
   setting (/wp-admin/options-permalink.php) from “Default” to “Post name”. I’m 
   from Russia, so, here peoples are using cyrillic alphabet and after i’m change
   that setting, wordpress will replace page id to alias.
    For example, on “news”
   word. On russian “news” word written as “Новости” I think now you see instead
   of the word, a kind of abracadabra, but it’s okay) and if that word used as alias
   for some page, than WordPress encode that word, and return something like that“/%
   D0%BD%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8/”.
 *     ```
       $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items );
       ```
   
 * As result, encoded url’s proceed by sprintf() through $args->items_wrap variable
   array row, that will be contain encoded url unicode entities from past wp_nav_menu()
   call (if i understood rightly), and they will be interpreted as patterns that
   must be filled by something on the second sprintf( $args->items_wrap ) run though
   second wp_nav_menu() call .
 * I think that to solve this issue, % symbol must be escaped, for example through
   simple str_replace(“%”, “%%”); as I did.
 * In file \wp-content\plugins\responsive-select-menu\responsive-select-menu.php
   on function display_element() i add str:
    `$element->url = str_replace("%", "%%",
   $element->url);` Result code is:
 *     ```
       function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
   
       		if ( !$element )
       			return;
   
       		global $responsiveMenuSelect;
   
       		if( $responsiveMenuSelect->getSettings()->op( 'uber-enabled' ) ){
   
       			$id_field = $this->db_fields['id'];
       			$id = $element->$id_field;
   
       			$display_on = apply_filters( 'uberMenu_display_item' , true , $this , $element , $max_depth, $depth, $args );
   
       			if( !$display_on ){
       				$this->clear_children( $children_elements , $id );
       				return;
       			}
       		}
   
       		$element->url = str_replace("%", "%%", $element->url);
       		Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
       		//UberMenuWalker::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
       	}
       ```
   
 * I can’t give guarantee, that this “hack” will be good in every issue, but in 
   my issue, i get menu generator that working now.
 * I’m really sorry for my English is bad. I’m was a bad student, just because of
   i couldn’t understand why i must be good student…
    So, parents! Please make your
   childrens to feel and to breathe life, and do not teach your childrens to be 
   just a calculator whether capitalist. Good luck! I wish you health!

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

The topic ‘Error Warning: sprintf() [function.sprintf]’ is closed to new replies.

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

 * 4 replies
 * 4 participants
 * Last reply from: [b0s](https://wordpress.org/support/users/b0s/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/error-warning-sprintf-functionsprintf/#post-4025801)
 * Status: not resolved