• 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 5 years, 6 months ago by Ryan Smith.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ryan Smith

    (@rscs)

    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

    (@namithjawahar)

    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.