Forums

How do I know if a plugin is activated or not? (8 posts)

  1. stopthepress
    Member
    Posted 7 years ago #

    I mean is there a function like:

    int plugin_activated(string filename);

    returning true or false?

  2. moshu
    Member
    Posted 7 years ago #

    If you look in your admin Panel > Plugins doesn't show at the end of each line an "Active" or "Deactivate" link?

  3. stopthepress
    Member
    Posted 7 years ago #

    Php code has no eyes to look at the admin panel.

  4. neetij
    Member
    Posted 7 years ago #

    I don't know if there is a function that works like the one you mention - someone with more experience may be able to help, however you can check if a function in the plugin exists, thus validating its activation.

    Lets say I want to check if Brian's Latest Comments plugin is activated, and if it is I want to display the latest comments.

    <?php if (function_exists('blc_latest_comments') { >
    <?php blc_latest_comments(); ?>
    <?php } ?>

  5. yearginsm
    Member
    Posted 7 years ago #

    I don't think that's what stopthepress was after, but here's one tool that I use on my site. Perhaps it's hackable.

    http://www.andrewsw.com/pages/pluginsUsedPlugin/

  6. yearginsm
    Member
    Posted 7 years ago #

    Whoops... drop the trailing slash:

    http://www.andrewsw.com/pages/pluginsUsedPlugin

  7. stopthepress
    Member
    Posted 7 years ago #

    Hmmm, yes it might work. will try.

  8. stopthepress
    Member
    Posted 7 years ago #

    Thanks neetij and yearginsm, will try both suggestions

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.