• Resolved cronwerk

    (@cronwerk)


    Hi!
    After plugin activation a message appears in debug.log about deprecated function wp_get_sites():
    PHP Notice: wp_get_sites is deprecated since version 4.6.0! Use get_sites() instead. in …/wp-includes/functions.php on line 3828
    But you say that the plugin is compatible up to: 4.7.2 of WP.

    Sincerely,
    A.Cronwerk

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter cronwerk

    (@cronwerk)

    I replaced all wp_get_sites() to get_sites() in all plugin files, but it caused the fatal error:
    “Fatal error: Cannot use object of type WP_Site as array in /var/www/wingywin.com/wp-content/plugins/wp-statistics/wp-statistics.php on line 494”

    Plugin Contributor Greg Ross

    (@gregross)

    It’s just a deprecation warning, you can safely ignore it for the time being and I’ll update the code for the next release.

    get_sites() isn’t a direct replacement for wp_get_sites() so no surprise you received a fatal error by a search/replace.

    Plugin Contributor Greg Ross

    (@gregross)

    I’ve committed a change for the next release to address this, as get_sites() is only available in 4.6 and above I’ve had to support both.

    Thread Starter cronwerk

    (@cronwerk)

    Greg, thanks a lot for your quick answer!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Deprecated function wp_get_sites’ is closed to new replies.