The MU forums have moved to WordPress.org

isMU() (4 posts)

  1. PerS
    Member
    Posted 19 years ago #

    Sorry if this been answered earlier (I've searched this forum). What's the best method to use in my plugin to check if it's installed on WP or MU ?

    This is the one I'm using now, but is there an "official" one ?:

    function isMU() {
    if (function_exist('is_site_admin')) {
    return true;
    } else {
    return false;
    }
    }

  2. lunabyte
    Member
    Posted 19 years ago #

    That would work. You want to definitely use something that WP doesn't, and won't use.

    You could check for one of the defined constants, but I don't think MU has anything different than WP at the moment. Although, it might be an idea to simply set one to designate it as MU, to help plugin dev's in the future.

  3. PerS
    Member
    Posted 19 years ago #

    Thanx lunabyte, is is_site_admin the best one to use or is there other MU methods that's safer to check for ?

  4. lunabyte
    Member
    Posted 19 years ago #

    Well, that is a function specific to MU that WP doesn't have a need for. And since it's only checking for the functions existence, it wouldn't be an issue.

About this Topic