Reply To: Generate Map from PHP

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


Ok I will try that.
I am using twenty ten.
Site is just localhost at present.Wordpress of course.
If it fails again I will email the source.

As a seperate attack on this problem I have also tried to programmatically create a post with my custom field to generate a Map.
The post is generated but not the map.
I first create a draft post, update the custom field and then update the post status to publish.
Any thoughts on this approach appreciated.
//create a new post to create a new map.
$postcode= ‘KT17’;
global $user_ID;
$my_post = array(
‘post_title’ => ‘Epsom’,
‘post_content’ => ‘Postcodes’,
‘post_status’ => ‘draft’,
‘post_date’ => date(‘Y-m-d H:i:s’),
‘post_author’ => $user_ID,
‘post_type’ => ‘post’,
‘post_category’ => array(0)
$new_post_id = wp_insert_post( $my_post );
if ($new_post_id == 0) {
echo ‘Could not create the post.’;
else {
echo ‘New post created.’;
update_post_meta($new_post_id, ‘postcode’, $postcode);//add the custom field
$status= ‘publish’;//set status to publish