Title: Using PHP 7.2 Create_Function() is deprecated
Last modified: July 25, 2020

---

# Using PHP 7.2 Create_Function() is deprecated

 *  [Gary H](https://wordpress.org/support/users/axe6st/)
 * (@axe6st)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/using-php-7-2-create_function-is-deprecated/)
 * The text boxes seem to be working correctly but when I enable debug mode i get
   the following error.
    Deprecated: Function create_function() is deprecated in
   W:\websites\www.mywebsitename.com\wp-content\plugins\wp-special-textboxes\wp-
   special-textboxes.php on line 48 How can I resolve this? I am ok with copying
   and pasting PHP code, but don’t understand it enough to know how to fix this.
   Thank you in advance.

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

 *  [errorsys](https://wordpress.org/support/users/errorsys/)
 * (@errorsys)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/using-php-7-2-create_function-is-deprecated/#post-13826818)
 * Change line 48 to:
    **add_action(‘widgets_init’, function() {return register_widget(“
   special_text”); } );** It should help.
 *  [hardoman](https://wordpress.org/support/users/hardoman/)
 * (@hardoman)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/using-php-7-2-create_function-is-deprecated/#post-14359868)
 * I have fixed it by replacing line 48 with:
 *     ```
       //  add_action('widgets_init', create_function('', 'return register_widget("special_text");'));
        	add_action('widgets_init', function() {
          return register_widget("special_text");
         }
         );
       ```
   

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

The topic ‘Using PHP 7.2 Create_Function() is deprecated’ is closed to new replies.

 * ![](https://ps.w.org/wp-special-textboxes/assets/icon-256x256.png?rev=1027834)
 * [Special Text Boxes](https://wordpress.org/plugins/wp-special-textboxes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-special-textboxes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-special-textboxes/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-special-textboxes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-special-textboxes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-special-textboxes/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [hardoman](https://wordpress.org/support/users/hardoman/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/using-php-7-2-create_function-is-deprecated/#post-14359868)
 * Status: not resolved