title: Php error "Undefined variable:post" when using "get_post_thumbnail_id($post->ID)"
body: <p>I have a line of php to get the thumbnail image in my custom wordpress widget:</p>
  
  <pre><code>$footer_recent_thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post-&gt;ID), 'footer-recent-thumbnail' );
  </code></pre>
  
  <p>It produces two php errors:</p>
  
  <pre><code>NOTICE: customwidgets.php:75 - Undefined variable: post
  NOTICE: customwidgets.php:75 - Trying to get property of non-object
  </code></pre>
  
  <p>How can I resolve this?  It is the same php I use to get the thumbnail on the blog and it doesn't give an error there.</p>