Ejemplo n.º 1
0
/**
 * This function determines whether the current user is able to manage the plugin or not.
 *
 * @return boolean PHPDOC
 *
 * @since PHPDOC
 */
function nelioab_can_user_manage_plugin()
{
    // If the user is super admin, he can use the plugin
    if (is_super_admin()) {
        return true;
    }
    // If we're in a multisite, admin users should be able to use the plugin.
    // But, who's admin? The super admin or a site admin? That depends...
    if (NelioABSettings::regular_admins_can_manage_plugin()) {
        if (current_user_can('manage_options')) {
            return true;
        }
    }
    return false;
}