Utilizing a wordpress plugin in wordpress, I'm trying to pass through the publish info with the tumblr api also to publish it to my tumblr blog.

Everything works aside from the very fact I recieve a double publish around the tumblr finish, and that i have no idea why.


function getImgSrc($postID)

accessories = get_children( array(

        'post_type' => 'attachment',

        'post_mime_type' => array('image'),

        'numberposts' => 1,

        'post_status' => null,

        'post_parent' => $publish->ID

        )))

        foreach ($accessories as $attachment) wordpress_get_attachment_url( $attachment->ID )

    

    return $t_source



//publish blog to tumblr

function postBlogTumblr($postID)

publish = get_publish($postID)

    $tumblr_data = unserialize(get_option("tumblr"))

    $postdata['email'] = $tumblr_data['tumblr_login_email']

    $postdata['password'] = $tumblr_data['tumblr_login_pass']

    $postdata['type'] = "photo"

    $postdata['source'] = getImgSrc($postID)

    $postdata['caption'] = $t_publish->post_title

    $postdata['state'] = "released"

    $postdata = http_build_query($postdata)

    $result = datapost($URLServer,$postdata)



function postBlogTumblr($postID)

publish = get_publish($postID)

    $tumblr_data = unserialize(get_option("tumblr"))

    $postdata['email'] = $tumblr_data['tumblr_login_email']

    $postdata['password'] = $tumblr_data['tumblr_login_pass']

    $postdata['type'] = "regular"

    $postdata['title'] = $t_publish->post_title

    $postdata['body'] = $t_publish->post_content

    $postdata['state'] = "released"

    $postdata = http_build_query($postdata)

    $result = datapost($URLServer,$postdata)



Any guidance could be greatly appreciated.

Out of your published code, I'm able to only suspect you are obtaining a double publish because you have copied the function postBlogTumblr().