The MU forums have moved to WordPress.org

How to Limit to site_admin (1 post)

  1. Taylor0330
    Member
    Posted 17 years ago #

    I am working at customizing plugins that reside in the plugin directory and cannot reside in the MU plugin directory.

    I am attempting to only add accessibility to some of the plugins for MU site admin and disallow access to change or edit those plugins by sub-blog admins.

    I am moving some option tabs to the Site admin tab -- where I can. In other cases I can't figure out how to do that.

    Question 1. Since every plugin author calls to add an admin menu, and corresponding options menu (where applicable) in many different ways is there a standard set of commands to add the plugin options tab to the site admin tab in mu?

    2. Alternatively where that can't be done, or as an alternate approach what command can be used and in front of what functions to limit the addition of the options menu only if it is the site mu admin and not a sub blog admin?

    I have tried the following:

    get_currentuserinfo();
    if( is_site_admin() )

    OR

    get_currentuserinfo();
    global $user_ID;
    if( is_site_admin() )

    OR

    global $user_ID;
    if( is_site_admin() )

    I am only able to get the first and the third to work and I can only get the plugins to take the changes based on trial and error -- as to which one works and which one spits out a fatal error.

    Question 2. Is there a hook that should be called every time prior to this? If so, what is it? Can you explain the correct way to do this and why?

    Question 3. if( is_site_admin() ) only refer to the WPMU admin user or does it also refer to each subdomain blog site admin? If refers also to subdomain blog site admin, how do you properly refer to only the WPMU site admin user to limit to only that user specifically?

    Thank you in advance for any assistance you can provide.

About this Topic

  • Started 17 years ago by Taylor0330