inboundnow / retired-leads

Track visitor activity, capture and manage incoming leads, and send collected emails to your email service provider for WordPress
http://www.inboundnow.com/leads/
11 stars 3 forks source link

Bug when not using the default wp-content location #181

Closed Xayer closed 7 years ago

Xayer commented 8 years ago

Hello.

In shared/shortcodes/shortcodes-fields.php on line 9. you are hardcoding the wp content folder. You should be using the CONTENT_DIR constant defined in wp-config.

So the code should be written a little like so:

/*  Include wp-load
    *   ----------------------------------------------------- */
    /*  Include wp-load
    *   ----------------------------------------------------- */
    $path_to_file = explode( CONTENT_DIR, __FILE__ );
    $path_to_wp = $path_to_file[0];
.......
atwellpub commented 8 years ago

Thank you have the change added in. Will monitor it for performance and let it live in the next update.

Xayer commented 8 years ago

@atwellpub I'm not entirely certain that the exact piece of code will work in practice, or that it's the right constant that I've used. But it should guide you in the right direction at least.

atwellpub commented 8 years ago

Thanks for that warning. When I tested this is what I ended up using:

/*  Include wp-load
    *   ----------------------------------------------------- */
    $path_to_wp =  get_home_path();
    require_once( $path_to_wp . '/wp-load.php' );
Xayer commented 7 years ago

@atwellpub yes, exactly. Glad to be of service 👍