Advertisement
Guest User

Untitled

a guest
Jul 1st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Code 1: https://wordpress.stackexchange.com/questions/307150/save-attachment-custom-fields-on-front-end?noredirect=1&lq=1
  2. --
  3.  
  4. $vid_pix = get_post_meta($v_Id, 'vid_pix', false);
  5.  
  6. if (!empty($vid_pix)) {
  7. foreach ($vid_pix as $vP) {
  8. $Pt = get_post_meta($vP, 'photo_time', true);
  9. $Por = get_post_meta($vP, 'photo_order', true);
  10.  
  11. echo '<img src="' . wp_get_attachment_thumb_url($vP) . '" alt=""/>';
  12. echo '<input type="hidden" name="photo_order" class="photo_order" value="'.$Por.'" />';
  13. echo '<input type="text" name="photo_time" class="photo_time" value="'.$Pt.'"/>';
  14. }
  15. }
  16.  
  17. Code 2: https://wordpress.stackexchange.com/questions/307065/change-order-of-images-attached-to-post?noredirect=1&lq=1
  18. --
  19.  
  20. <div id="pic-con">
  21. <?php
  22. if (!empty($vid_pix)) {
  23. foreach ($vid_pix as $vP) {
  24. $filename = basename( get_attached_file( $vP ));
  25. echo '<div class="photo-upload-box">';
  26. echo '<img src="' . wp_get_attachment_thumb_url($vP) . '" alt=""/>';
  27. echo '<input type="hidden" class="pic_value" value="' . $filename . '" />';
  28. echo '<input type="hidden" name="'.$vP.'" class="orders" />';
  29. echo '</div>';
  30. }
  31. }
  32. ?>
  33. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement