i would like to have the function that is used at CSV import, which also maps the fields and calculates GPS.
If I buy the add-on, do I have such a function and if so, what is it called?
The code in the CSV Manager runs on import only, so it’s not a standalone function that you can use.
But if your comfortable with code use wp_insert_post and set the post type to wpsl_stores.
Next set the meta data with the returned post id with update_post_meta. You can get a list of used meta fields with this function.
Geocoding the address can be done with this function.
I will create a single function to get this done in the next update.
okay thanks for the quick response.
That’s what I call good support, i like it
When would the function be available?
And how do I get the “wpsl_get_address_latlng” function in the function.php? The rest I know and can implement myself.
You will have to include the /plugins/wp-store-locator/inc/wpsl-functions.php file in the functions.php to call the wpsl_get_address_latlng function, or just copy the code and place it in a custom function.
okay i get the error:
Cannot redeclare wpsl_get_gmap_api_params() (previously declared in wp-content/plugins/wp-store-locator/inc/wpsl-functions.php:12)
i included like this:
$file = ABSPATH.’wp-content/plugins/wp-store-locator/inc/wpsl-functions.php’;
include($file);
and used it like this:
$longlat = wpsl_get_address_latlng( $fields[ ‘street’ ].’ ‘.$fields[ ‘nr’ ] .’, ‘.$fields[ ‘city’ ] );
Try changing include($file) into require_once( $file );
okay thx it works fine.
YOu can add the post and meta in one function.
Now i have another question.
I need to ” Clear store locator transient cache” that it will show, wen you don’ filld the search form.
Is there a function for that?
Try this.
$wpsl_admin = new WPSL_Admin();
$wpsl_admin->delete_autoload_transient();