• I want users to be able to add placemarks from the front end using a form. I have the form and am posting to another file where the post data is then put into an array and inserted as a post using wp_insert_post.

    Depending on which category a user selects the Placemark will be a different coloured marker.

    My issue is when a user attempts to add a placemark for the first time or have cleared their cache, the taxonomy category is not inserted into the database. Therefore the default placemark icon is used.

    Please see my code below.

    $ptitle = $_POST[‘title’];
    $content = $_POST[‘content’];
    $pt = $_POST[‘project_type’];

    $my_post = array(
    ‘post_title’ => $ptitle ,
    ‘post_type’ => ‘bgmp’,
    ‘post_content’ => $content,
    ‘post_status’ => ‘publish’,
    ‘post_author’ => 1,
    ‘tax_input’ => array(‘bgmp-category’ => array($pt))
    );

    $post_id = wp_insert_post( $my_post );

    Thanks in advance for your help!

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

The topic ‘[Plugin: Basic Google Maps Placemarks] Insert bgmp taxonomy post’ is closed to new replies.