dopgv00024 2012-09-12 04:45
浏览 61
已采纳

Junction / Symlink导致插件url()返回错误的URL

I'm testing my plugin in various WordPress versions and using symbolic links for it. I use the tool called Junction for Windows. This way I just only need to edit the trunk files. However, WordPress does not seem to handle symbolic links very well.

For example, if I run a plugin with the following code.

<?php
/*
    Plugin Name: Junction/Simlink Test
*/
echo __FILE__ . '<br />';
echo plugins_url('junctiontest.php', __FILE__) . '<br />';
?>

and create a symbolic link, (this is for Windows)

junction "z:\xampp\htdocs\wp34\wp-content\plugin\junctiontest2" "Z:\xampp\htdocs\wpcurrent\wp-content\plugins\junctiontest"

when I open the admin page of the test site with the url of wpcurrent, I get

Z:\xampp\htdocs\wpcurrent\wp-content\plugins\junctiontest\junctiontest.php
http://localhost/wpcurrent/wp-content/plugins/junctiontest/junctiontest.php

However, when I open the admin page of the test site with the url of wp34, I get

Z:\xampp\htdocs\wpcurrent\wp-content\plugins\junctiontest\junctiontest.php
http://localhost/wp34/wp-content/plugins/Z:/xampp/htdocs/wpcurrent/wp-content/plugins/junctiontest/junctiontest.php

This breaks the linked plugin.

So any suggestion to avoid this? I do not like to copy and paste the plugin into each directory every time I make a change in the trunk files.

I found this page: http://core.trac.wordpress.org/ticket/16953 It seems this is a known issue held by many plugin developers and it hasn't been solved.

  • 写回答

1条回答 默认 最新

  • dqm4675 2012-09-12 19:11
    关注

    Use a folder synchronization tool such as DSYNCHRONIZE.

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

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?