title: How to pass variables between my wordpress page content and sidebar widget
body: <p>I am editing nextgen gallery plugin which comes with the $image object.  I want to be able to pass this $image object to my php widget in my sidebar so I can echo cotent there about the $image. How can I do this?</p>
  
  <p>Here is example of what is in my template which I want in the sidebar.  When I paste the php in it doesn't work because it doesn't have reference to the $image object.</p>
  
  <pre><code>&lt;?php if(!empty($image-&gt;ngg_custom_fields["buy-1"])){?&gt;
  
              &lt;ul class="buying-list"&gt;
                  &lt;li&gt;&lt;?php echo $image-&gt;ngg_custom_fields["text-1"]; ?&gt; &lt;/li&gt;
                  &lt;li&gt;&lt;?php  echo $image-&gt;ngg_custom_fields["buy-1"]; ?&gt; &lt;/li&gt;
              &lt;/ul&gt;
          &lt;?php }; ?&gt;
  </code></pre>