plugins_url() function accepts plugin slug or file path to build URL for.
I have following directory structure:
I need to build URL to
file.php. I can't pass
__FILE__ because that will be one level too deep.
plugins_url('css/file.css', __FILE__ )
I can pass
__DIR__ to get correct level and it seems to work, but it's not documented as allowed and I am not sure there isn't something to bite me later with this.
plugins_url('css/file.css', __DIR__ )
So, is this adequate? Any better way to build URL for these conditions?