how to lock custom features using prosites

I have a custom plugin that contains numerous settings. I would like restrict a subset of settings to certain prosite levels. Can you point me to information our developers could use in order to accomplish this?

Thanks!

  • Tyler Postle

    Hey WP Tech,

    Hope you're doing well today!

    You would need to add it as a custom function in something like a mu-plugin so it applies to your entire network :slight_smile:

    You can target each level like this:

    <?php
    global $wpdb;
    $blog_id = $wpdb->blogid;
    $sql = "SELECT level FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$blog_id'";
    $level = $wpdb->get_var($sql);
    ?>
    <?php if ($level == 1){ ?>
    	Level 1 content here
    <?php } ?>
    <?php if ($level == 2) { ?>
    	Level 2 content here
    <?php } ?>
    <?php if ($level == 3) { ?>
    	Level 3 content here
    <?php } ?>

    This allows you to allow different content for different levels.

    Hope this helps!

    All the best,
    Tyler