Reply To: Generate Map from PHP

Home Forums MapPress Support Generate Map from PHP Reply To: Generate Map from PHP

#15676
Chris
Keymaster

Hi,

MapPress can generate maps from custom fields, but it’s really intended for use from the WP post editor or during data imports, not from PHP programs.

There are two problems with the code above:
1. It looks like you’re setting a variable $status to ‘publish’, not actually publishing the post.

2. When post data (or status) is updated, try calling wp_update_post() to trigger the ‘save_post’ action. MapPress uses that hook.

You might also want to try get this working from the admin first, before trying to call it from a program:
1. Edit the post in the WP post editor
2. Set your custom fields
3. Publish to create the map.