doushen8391 2013-01-13 23:27
浏览 105
已采纳

文件路径和dirname中的空格(__ File__)

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.

  • 写回答

1条回答 默认 最新

  • dqly83915 2013-01-13 23:42
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办