Support » Plugin: Honeypot Toolkit » On activation in Multisite: wp_get_sites is deprecated

  • Hi,

    Activating Honeypot Toolkit in a Multisite environment results in a PHP Notice:

    PHP Notice: wp_get_sites is <strong>deprecated</strong> since version 4.6.0! Use get_sites() instead. in /data/www/ on line 3853

    I fixed this for you, in two files:


    Find line 546:$networkSites = wp_get_sites(); and change that to:
    $networkSites = get_sites();

    Then on line 551: switch_to_blog($site['blog_id']); change that to:
    switch_to_blog( $site->blog_id );

    Do the same on lines 7 and 12 of uninstall.php

    • This topic was modified 3 years, 8 months ago by Jan Reilink.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Sterup


    Sorry. Not sure why I didn’t get that deprecated message. I made the changes you proposed and tested them in my test environment. I just released version 4.0.4 with the changes. Thanks for the heads up.

    Thread Starter Jan Reilink


    Great, thanks Jeff!
    I haven’t checked, but switch_to_blog() may be in use in other scripts (or other lines) as well.

    I’ll mark this reply as resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘On activation in Multisite: wp_get_sites is deprecated’ is closed to new replies.