Make AdRotate Pro work with PHP7.2

Home Forums AdRotate for WordPress Bug Reports Make AdRotate Pro work with PHP7.2

  • #46532


    I’ve made this modification in my installation to avoid DEPRECATED messages when using PHP 7.2, because create_function doesn’t exist anymore.

    diff --git a/wp-content/plugins/adrotate-pro/adrotate-pro.php b/wp-content/plugins/adrotate-pro/adrotate-pro.php
    index ea873a5a..1b9f834a 100644
    --- a/wp-content/plugins/adrotate-pro/adrotate-pro.php
    +++ b/wp-content/plugins/adrotate-pro/adrotate-pro.php

    -add_action('widgets_init', create_function('', 'return register_widget("adrotate_widgets");')); // Depreciated widget
    -add_action('widgets_init', create_function('', 'return register_widget("ajdg_grpwidgets");')); // Group widget
    -add_action('widgets_init', create_function('', 'return register_widget("ajdg_bnnrwidgets");')); // Advert widget
    -if(adrotate_is_networked()) add_action('widgets_init', create_function('', 'return register_widget("ajdg_nwidgets");')); // Network widget
    +add_action('widgets_init', function() {
    + return register_widget("adrotate_widgets");
    +add_action('widgets_init', function() {
    + return register_widget("ajdg_grpwidgets");
    +add_action('widgets_init', function() {
    + return register_widget("ajdg_bnnrwidgets");
    +if (adrotate_is_networked()) {
    + add_action('widgets_init', function() {
    + return register_widget("ajdg_nwidgets");
    + });

    Would it be possible you add these lines to the plugin?

    Kind regards,


    Arnan de Gans

    The function exists just fine, it’s merely depreciated so that it can be removed in a future version of PHP. Which can take years.

    The next version already removed the use of the create_function .

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

The topic ‘Make AdRotate Pro work with PHP7.2’ is closed to new replies.

You may be interested in