Wordpress / PHP related question.
I have a Wordpress plugin that uses dirname(__File__)
to retrieve some .js files from a theme folder.
The theme folder has a space in the name ie: "My Theme".
dirname(__File__)
appears to be ignoring the space and is trying to load /MyTheme/script.js
and so the script is not found.
Any help to rectify this problem (without removing the space from the directory name) would be much appreciated.
Regards.
To start with, as others have said, spaces in file paths are not good. Second a WordPress plugin should never be tied to a specific theme.
If the plugin is theme specific, you should just include it in the theme's functions.php, that way you have easy access to everything in the theme