Support » Plugin: Content Randomizer » Compatibility with PHP 7.x

  • I’m getting ready to jump up to PHP 7.2, and the PHP Compatibility Checker plugin shows:

    234 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
    237 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead

    for /content-randomizer/includes/widgets.php

    Is there any chance for a fix sometime soon?

    Thank you,
    Grant.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Deprecated: Function create_function() is deprecated in /…/wp-content/plugins/content-randomizer/includes/widgets.php on line 234

    Deprecated: Function create_function() is deprecated in /…/wp-content/plugins/content-randomizer/includes/widgets.php on line 237

    Fix widgets.php

    Replace

    add_action('widgets_init',
         create_function('', 'return register_widget("Randomizer_Widget");')
    );
    add_action('widgets_init',
         create_function('', 'return register_widget("RandomizerSlideshow_Widget");')
    );

    By

    add_action('widgets_init',
         function() {return register_widget("Randomizer_Widget");}
    );
    add_action('widgets_init',
         function() {return register_widget("RandomizerSlideshow_Widget");}
    );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatibility with PHP 7.x’ is closed to new replies.