Support » Plugins » Hacks » Post thumbnail in $_POST array?

  • Hello,

    I’m making a basic php basket and i’m trying to retrieve different informations. So far so good I got the title, the content, the permalink everything is working at intended. But i’d like to save the_post_thumbnail in an input hidden like this :

    <input type=’hidden’ name=’thumbnail_image’ value=”<?php the_post_thumbnail(); ?>” />

    The problem is that it returns me a number. But I’ve basically never done this in the past even with a basic image. So how should I proceed save this picture in my array?

    Thanks for your help.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    the_post_thumbnail() outputs the HTML to display the thumbnail, it does not return anything meaningful. What is it you are actually trying to get, the thumbnail URL? That is returned by wp_get_attachment_thumb_url(), but if the call is not in the “Loop”, you must provide the post ID as a parameter.

Viewing 1 replies (of 1 total)
  • The topic ‘Post thumbnail in $_POST array?’ is closed to new replies.