Plugin Directory Not Set Properly
-
You are using the following code to set your plugin directory (which you use as the base to enqueue js, etc):
$yumprint_directory = get_option('siteurl') . '/wp-content/plugins/' . dirname(plugin_basename(__FILE__))
The problem is that if you use a custom content directory (which I do on pretty much all my sites, as do many people, using a setup very similar to Mark Jaquith’s Skeleton) then your plugin detects it’s location wrong.
WordPress has
plugins_url()
for this and you can replace your code with this to fix it (if you have a github repo or anything, I can make a pull request):
$yumprint_directory = plugins_url( '', __FILE__ );
Additional information:
https://codex.www.ads-software.com/Determining_Plugin_and_Content_Directories
https://developer.www.ads-software.com/reference/functions/plugins_url/
- The topic ‘Plugin Directory Not Set Properly’ is closed to new replies.