WordPress.org

Ready to get started?Download WordPress

Forums

Disabling Plugins for Subscriber/Author (3 posts)

  1. takuhii
    Member
    Posted 6 years ago #

    How can I disable a plugin so only Administrators can use it, I've tried Role Manager, but my plugin inserts code into the WYSIWIG editor area, and I really only want this functionality for myself.

  2. sasch9r
    Member
    Posted 6 years ago #

    I haven't tested it yet, but you could try something like this:

    Put this in front of plugin's code:

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

    And after the code you could try this:

    }
    else {
    # This part should be empty i thin.
    #So non-admins can't use the plugin's functions.

    }

  3. takuhii
    Member
    Posted 6 years ago #

    didn't work :(

Topic Closed

This topic has been closed to new replies.

About this Topic