php undefined index error with if/else shortcode <p>I am trying to clean up my error log. This error is still generated:</p> <pre><code>[Tue Apr 24 06:09:32 2012] [error] [client 44.444.69.28] PHP Notice: Undefined index: current_id in /srv/www/virtual/website.com/htdocs/wp-content/themes/mimbo/sidebar.php on line 12 </code></pre> <p>from this code:</p> <pre><code>$posts = get_posts('numberposts=4&amp;exclude=' . isset($GLOBALS['current_id']) ? $GLOBALS['current_id'] : '' . '&amp;category='. $category-&gt;term_id); </code></pre> <p>and I have also tried this:</p> <pre><code>$posts = get_posts('numberposts=4&amp;exclude=' . array_key_exists('current_id',$GLOBALS) ? $GLOBALS['current_id'] : '' . '&amp;category='. $category-&gt;term_id); </code></pre> <p>I added the if/else shortcode to check the current id which I thought would eliminate the error, but it still has not gone away.</p>