最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Retrieving a path when dealing with composer packages

programmeradmin1浏览0评论

Within my composer package, I require a script be enqueued, I get its "base" path with plugin_dir_url( __FILE__ ) and then append Assets/JS/my_script.js to get the full path, problem is, if someone installs my package and uses it inside a theme, that function isn't going to work, yet the package itself is supposed to work just fine.

What is the alternative here? Isn't there a function that tells me the current path I'm in, no matter if a plugin or theme?

发布评论

评论列表(0)

  1. 暂无评论