Title: create_function deprecated in PHP v7.2
Last modified: May 28, 2019

---

# create_function deprecated in PHP v7.2

 *  Resolved [Ryan Smith](https://wordpress.org/support/users/rscs/)
 * (@rscs)
 * [7 years ago](https://wordpress.org/support/topic/create_function-deprecated-in-php-v7-2/)
 * Your “widgets_init” action uses the deprecated create_function() method, which
   causes warnings to be thrown in PHP >= 7.2.
 * Please change the code to use a PHP anonymous function, supported since PHP v5.3
   and is compatible with the WordPress minimum requirement of PHP v5.6.
 * `add_action('widgets_init', function() { register_widget("wpInsertAdWidget");});`
    -  This topic was modified 7 years ago by [Ryan Smith](https://wordpress.org/support/users/rscs/).

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

 *  Thread Starter [Ryan Smith](https://wordpress.org/support/users/rscs/)
 * (@rscs)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/create_function-deprecated-in-php-v7-2/#post-11775442)
 * I see you made a change in r2110652 for this by adding a new wp_insert_adwidgets_register_widget()
   function, but you’re not actually calling it. The action hook is still calling
   create_function().
 * Line 25 should be changed to use the new function:
 * `add_action('widgets_init', 'wp_insert_adwidgets_register_widget');`
 *  Plugin Author [Namith Jawahar](https://wordpress.org/support/users/namithjawahar/)
 * (@namithjawahar)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/create_function-deprecated-in-php-v7-2/#post-11775517)
 * Thanks for point that out. Latest version updated.

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

The topic ‘create_function deprecated in PHP v7.2’ is closed to new replies.

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

## Tags

 * [deprecated function](https://wordpress.org/support/topic-tag/deprecated-function/)

 * 2 replies
 * 2 participants
 * Last reply from: [Namith Jawahar](https://wordpress.org/support/users/namithjawahar/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/create_function-deprecated-in-php-v7-2/#post-11775517)
 * Status: resolved