Are there functions for file paths, instead of just urls

Is there any equivalent to functions like plugins_url() and content_url() that give you either the relative paths or the file path.

For instance, instead of

Read More

http://localhost:8888/wordpress-3.2/wp-content

I want:

/Users/username/Sites/wordpress-3.2/wp-content

I know that I can build this path using the ABSPATH constant, but I’m specifically interested in learning if there are built in functions to handle this.

In the meantime, I’ll probably just write a function to swap the url for the abspath.

EDIT: Here’s the simple function that I wrote to handle this:

function get_file_path($url)
{
    return str_replace(site_url(), ABSPATH, $url);
}

Seems to do the trick, but I’d much rather use built in functions if available.

Related posts

Leave a Reply

2 comments