acf-location-field icon indicating copy to clipboard operation
acf-location-field copied to clipboard

Activating / including with WP_PLUGIN_DIR instead of dirname( __FILE__ )

Open paullarrow opened this issue 12 years ago • 1 comments

Had some trouble with the instruction to add the following to functions.php: include_once( rtrim( dirname( FILE ), '/' ) . '/acf-location-field/location-field.php' );

Reason #1 The directory is installed as "advanced-custom-fields-location-field-add-on", not "acf-location-field".

Reason #2 dirname( FILE ) produced the file path to the theme directory. Instead I used: include_once( WP_PLUGIN_DIR . '/advanced-custom-fields-location-field-add-on/location-field.php' ); Maybe I shouldn't be using a WP constant, but my server required a file path and didn't like URLs.

Hope this is of some help and let me know if there's a better way.

Thank you! -Paul

paullarrow avatar Feb 12 '13 17:02 paullarrow

Thanks for pointing that out!

julienbechade avatar Feb 20 '13 11:02 julienbechade