Sorry but I'm really not a coder and can't quite figure out what that code is doing or how I need to change it to invoke the watermarking function. I'm quite helpless with that..
add_action("gform_after_submission", "set_post_content", 10, 2);
function set_post_content($entry, $form){
//getting post
$post = get_post($entry["post_id"]);
//changing post content
$post->post_content = "Blender Version:" . $entry[7] . "<br/> <img src='" . $entry[8] . "'> <br/> <br/> " . $entry[13] . " <br/> <img src='" . $entry[5] . "'>";
//updating post
wp_update_post($post);
}
I'm thinking that I need to change the part after changing post content. But I'm not sure how to write the code that will get the image file name, and run the function I need.
should it be something like this?
add_action("gform_after_submission", "watermark_post_image", 10, 2);
function watermark_post_image($entry, $form){
//Get post image
$photopost_id = get_post($entry["post_id"]);
// Here's where I get stuck -- what do I write to call the uploaded image for watermarking?
//Watermark post image
MM_Execute_WM($file,'');
My image field is ID 3 in the form. I am really stuck at this point.. please help me out?
Posted 13 years ago on Thursday November 3, 2011 |
Permalink