I have a file that can either be included in a plugin, or in a theme. What's the best way to get the URL of the file's folder (from within the file)?
I'm now using this for now
home_url( '/' . str_replace( ABSPATH, "", dirname( __FILE__ ) ) );
Let me know if there's any problem with this / there's a better way.