WordPress.org

Ready to get started?Download WordPress

Forums

Getting wp-content path from plugin (3 posts)

  1. Alex Dunae
    Member
    Posted 5 years ago #

    What is the best way to get the path to wp-content from a plugin.

    I'm currently using
    $wp_content_directory = realpath(dirname(__FILE__) . '/../../');
    but it seems pretty ugly. I'm also worried that someone could have files in a non-standard location.

  2. Alex Dunae
    Member
    Posted 5 years ago #

    Found my own answer: WP_CONTENT_URL and WP_CONTENT_DIR

  3. Lester Chan
    Member
    Posted 5 years ago #

    content_url()

Topic Closed

This topic has been closed to new replies.

About this Topic