Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Wrong path for plugins directory
This topic contains 2 replies, has 2 voices, and was last updated by epiphron 8 years, 9 months ago.
- AuthorPosts
- February 24, 2015 at 3:16 pm #4009
Hi, I have a WordPress Bedrock installation http://roots.io/wordpress-stack/
Bedrock modifies the default WordPress directories. Unfortunately this means I’m having a problem with Ajax Search Pro.
The asp.shortcode.probox.php has a number of lines (11, 28, 56) which use file_get_contents() instead of plugins_url(), which breaks the plugin.
e.g. echo file_get_contents(ABSPATH . ‘wp-content/plugins/’ . $style[‘magnifierimage’]);
I get an output like this:
/var/www/wp-site/web/wp/wp-content/plugins/ajax-search-pro/img/svg/magnifiers/magn4.svgInstead of this:
/var/www/wp-site/web/app/plugins/ajax-search-pro/img/svg/magnifiers/magn4.svgIs there any way this can be fixed? I can edit the code myself for now, but I don’t want to have to support my client’s sites every time they update the Ajax Search Pro plugin and overwrite my changes.
Best,
JamesFebruary 24, 2015 at 5:05 pm #4012Hi!
I’m currently working on the upcoming version and if I remember correctly I fixed this as someone reported something similar with the paths.
I think there are only 3 instances of ABSPATH there in the current version. The fixed lines look like this now:
echo file_get_contents(WP_PLUGIN_DIR . '/' . $style['magnifierimage']);
Would you mind checking if this solution is working in your case? A core developer suggested using the WP_PLUGIN_DIR constant as it should hold the correct plugin directory at all times.
I will mark this path issue solved if you can confirm that this solution works, and we don’t need to worry about this in the future versions anymore 😉
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 24, 2015 at 5:15 pm #4014Hey Ernest, thanks for the quick reply. I’ve tested your code and it works fine. Thanks for the help!
- AuthorPosts
You must be logged in to reply to this topic.