WordPress.org

Ready to get started?Download WordPress

Forums

Getting the directory of another plugin (5 posts)

  1. vaxace
    Member
    Posted 12 months ago #

    I'm writing a plugin wherein I need to get the directory of another plugin.

    The only functions that I've found that return a plugin directory all require a file within that plugin to be passed to them (e.g. plugin_dir_path( __FILE__ );).

    This obviously won't work in my situation since I don't have the plugin's file.

    Suggestions?

    Thanks in advance.

  2. bcworkz
    Member
    Posted 11 months ago #

    The option 'active_plugins' contains an array of the main filenames of all active plugins (relative to wp-content/plugins/).

  3. vaxace
    Member
    Posted 11 months ago #

    Interesting.
    What do you mean by "option", though.
    Is that a setting (get_option( 'active_plugins' );)
    or a global variable, or a function, or an action or filter?

    Thanks!

  4. bcworkz
    Member
    Posted 11 months ago #

    I should have been more specific, I know as well as anyone that many WP terms are confusingly ambiguous. (heh, including 'terms')

    I mean an entry in the options table retrieved with get_option( 'active_plugins').

  5. vaxace
    Member
    Posted 11 months ago #

    Great. Thanks for the info.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.