Title: Missing argument in functions.php
Last modified: August 21, 2016

---

# Missing argument in functions.php

 *  Resolved [DonTorpedo](https://wordpress.org/support/users/dontorpedo/)
 * (@dontorpedo)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/missing-argument-in-functionsphp/)
 * I created a new Sidebar for one Page and added a widget, but there comes a error:
 * can someone halp me solve this problem?
 * Warning: Missing argument 2 for change_widget_title() in functions.php on line
   157
 * Warning: Missing argument 3 for change_widget_title() in functions.php on line
   157
 * code in the functions.php:
 *     ```
       add_filter('widget_title', 'change_widget_title', 10, 3);
       function change_widget_title($title, $instance, $wid){
       	preg_match('/\[(.+)\]/', $title,$match);
       	if($match){
       		$title = preg_replace('/\[(.+)\]/',"<i class='$match[1]'></i>", $title);
       	}
           return $title;
       }
       ```
   
 * _[Please post code & markup between backticks or use the code button. Your posted
   code may now have been permanently damaged by the forum’s parser.]_
 * [http://wordpress.org/extend/plugins/simple-page-sidebars/](http://wordpress.org/extend/plugins/simple-page-sidebars/)

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

 *  Plugin Author [Brady Vercher](https://wordpress.org/support/users/bradyvercher/)
 * (@bradyvercher)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/missing-argument-in-functionsphp/#post-3941174)
 * Hi DonTorpedo, this code doesn’t come from the Simple Page Sidebars plugin, but
   the change might be pretty easy if you can replace it yourself.
 * _Just a warning that if this is in a theme that receives automatic updates, these
   changes will be wiped out by any future updates. If the code is in a plugin, 
   you’ll want to contact the author and have them update it._
 *     ```
       add_filter('widget_title', 'change_widget_title');
       function change_widget_title($title){
       	preg_match('/\[(.+)\]/', $title,$match);
       	if($match){
       		$title = preg_replace('/\[(.+)\]/',"<i class='$match[1]'></i>", $title);
       	}
           return $title;
       }
       ```
   
 *  Thread Starter [DonTorpedo](https://wordpress.org/support/users/dontorpedo/)
 * (@dontorpedo)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/missing-argument-in-functionsphp/#post-3941220)
 * thank you for your answer,
 * i forgot to mention, this error came from my Themes, function.php and also the
   code.
 * aaand your solution worked 🙂 thank you very mutch!!
 * pls can you explain for better understanding the code what you have removed?
   
   thank you
 *  Plugin Author [Brady Vercher](https://wordpress.org/support/users/bradyvercher/)
 * (@bradyvercher)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/missing-argument-in-functionsphp/#post-3941238)
 * The first line specified that he function should expect 3 parameters, but oftentimes
   some custom widgets won’t pass all three parameters, which can cause the error
   you were seeing. The `$widget` and `$wid` parameters weren’t being used in that
   function, so it’s safe to go ahead and remove them. The `10` in the first line
   is just the priority and it’s the default, so it could be removed as well.

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

The topic ‘Missing argument in functions.php’ is closed to new replies.

 * ![](https://ps.w.org/simple-page-sidebars/assets/icon.svg?rev=3245084)
 * [Simple Page Sidebars](https://wordpress.org/plugins/simple-page-sidebars/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-page-sidebars/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-page-sidebars/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-page-sidebars/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-page-sidebars/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-page-sidebars/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Brady Vercher](https://wordpress.org/support/users/bradyvercher/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/missing-argument-in-functionsphp/#post-3941238)
 * Status: resolved