Title: PHP error: Function create_function() is deprecated
Last modified: January 21, 2019

---

# PHP error: Function create_function() is deprecated

 *  Resolved [springthistle](https://wordpress.org/support/users/springthistle/)
 * (@springthistle)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/php-error-function-create_function-is-deprecated/)
 * Your plugin is generating a PHP error, and it is:
 * `PHP Deprecated: Function create_function() is deprecated in [...]/wp-content/
   plugins/like-box/includes/widget.php on line 179`
 * I have fixed this by replacing line 179 from this:
 * `add_action('widgets_init', create_function('', 'return register_widget("like_box_facbook");'));`
 * to this:
 *     ```
       add_action('widgets_init', 'like_box_register_widget');
   
       function like_box_register_widget() {
       	return register_widget("like_box_facbook");
       }
       ```
   
 * Please do the same so that I don’t have to fix the plugin after every update.
 * Thanks.

Viewing 1 replies (of 1 total)

 *  Plugin Author [smplug-in](https://wordpress.org/support/users/smplug-in/)
 * (@smplug-in)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/php-error-function-create_function-is-deprecated/#post-11209511)
 * Hi dear user.
 * Thanks a lot for this information, we will update our plugin and add this code
   on upcoming days.
 * Thanks.

Viewing 1 replies (of 1 total)

The topic ‘PHP error: Function create_function() is deprecated’ is closed to new
replies.

 * ![](https://ps.w.org/like-box/assets/icon-128x128.png?rev=2480659)
 * [Social Like Box and Page by WpDevArt](https://wordpress.org/plugins/like-box/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/like-box/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/like-box/)
 * [Active Topics](https://wordpress.org/support/plugin/like-box/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/like-box/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/like-box/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [smplug-in](https://wordpress.org/support/users/smplug-in/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/php-error-function-create_function-is-deprecated/#post-11209511)
 * Status: resolved