For one of my many sites, plugins/plugin-name
is a sym link pointing to universal-install/wp-content/plugins/plugin-name
.
echo WP_PLUGIN_URL
displays what I expect.
echo plugins_url();
displays what I expect.
echo plugins_url('',__FILE__)
displays what I expect followed immediately by the absolute path to the universal plugins directory.
Is there any way I can fix echo plugins_url('',__FILE__)
to return only the expected result?
When writing a plugin, I define a few constants including the path to the plugin’s root folder, and its “name” as used in some admin hooks:
I’ve found that
plugins_url()
happily takes that constant, which is useful when referencing files from subfolders of the plugin, like so:Maybe it’ll fix your problem.
Create plugin then put this code:
1)get plugin dictionary name
2)get plugin url path