黄聪:wordpress获取当前插件文件所在目录文件夹路径

例如,hello.php插件放在/wp-content/plugins/hello/文件夹中,那么要想得到/wp-content/plugins/hello/字符串,可以使用如下的形式:






<?php echo WP_PLUGIN_URL."/".dirname(plugin_basename(__FILE__)); ?>





原文地址:https://www.cnblogs.com/huangcong/p/2509559.html