I have been using these functions for quite a while now but yesterday I noticed that they were not working properly on a site where the plugin directory was outside the main WordPress folder.
WP_PLUGIN_URL have been set properly like so:
define( 'WP_PLUGIN_DIR', '/var/www/plugins' ); define( 'WP_PLUGIN_URL', 'http://test.com/plugins' );
Now if the value of
/var/www/plugins/forms-plugin/forms-plugin.php and I pass it to
plugin_basename(), I get this:
Instead of just the plugin name.
If I pass it to
plugin_dir_url(), I get:
Instead of the correct value: http://test.com/plugins/forms-plugin/
Everything works properly when the same plugin is placed inside the WP directory and the constants
WP_PLUGIN_URL are not used.
Am I doing something wrong?
Thanks for your help.