Advertisement
pszeinert

Pin it on Pinterest: Post Update Fix

Jan 17th, 2012
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. public function pinterest_html($post)
  2. {
  3.  
  4. $attachID=get_post_meta($post->ID,'_pin_image',true);
  5. $pin_desc=get_post_meta($post->ID,'_pin_description',true);
  6. $pin_image=wp_get_attachment_image(get_post_meta($post->ID,'_pin_image',true),'pinterest-thumb');
  7. if($pin_image){
  8. $bar=$pin_image.'<br /><div class="pin-actions"><a href="#">Remove Image</a></div>';
  9. }
  10.  
  11. $html=wp_nonce_field('save_pinterest_options','_pin_field',true,false);
  12. $html.='
  13. <div id="pinterest-options">
  14. <div class="pin_option">
  15. <label for="pin_description" class="full_label">Description:</label>
  16. <textarea name="pin_description" id="pin_description">'.$pin_desc.'</textarea>
  17. </div>
  18. <div class="pin_clearer"></div>
  19. <div class="pin_option">
  20. <div class="col1_2"><label for="pin_image">Image:</label></div>
  21. <div class="col1_2"><input type="button" class="button-secondary" id="pin_add_image" value="Choose file to upload" /></div>
  22. </div>
  23. <div class="pin_clearer"></div>
  24. <div class="pin_image_container">
  25. <input type="hidden" name="pin_image" id="pin_image" value="'.$attachID.'" />
  26. '.$bar.'
  27. </div>
  28. <div class="pin_clearer"></div>
  29. </div>
  30. <div class="last_clearer"></div>';
  31. echo $html;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement