WordPress.org

Ready to get started?Download WordPress

Forums

Enabling `bloginfo('plugins_directory')` (3 posts)

  1. JoannesVermorel
    Member
    Posted 9 years ago #

    It seems that bloginfo('plugins_directory') is not available is WP 1.5. It would be convenient to provide such path in some cases. Is-it planned for WP 1.6 ?

    Thanks

  2. Kafkaesqui

    Posted 9 years ago #

    "Is-it planned for WP 1.6 ?"

    I doubt it.

    bloginfo() primarily displays a selection of data stored in the options table. No information about the plugins directory is retained there, probably because it has a permanent location in relation to the WordPress installation (unlike say the active theme's template directory). If you need access to the plugins directory, for a path use something like:

    $plugins_dir = ABSPATH . 'wp-content/plugins/';

    and for a url:

    $plugins_url = get_bloginfo('url') . '/wp-content/plugins/';

  3. JoannesVermorel
    Member
    Posted 9 years ago #

    Thanks for the tips. It is a straightforward solution.

    Nevertheless, since there is already a get_bloginfo('template_directory'), I would think that it would be consistent to also have a get_bloginfo('plugins_directory').

Topic Closed

This topic has been closed to new replies.

About this Topic