acf-location-field
acf-location-field copied to clipboard
Activating / including with WP_PLUGIN_DIR instead of dirname( __FILE__ )
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
Thanks for pointing that out!