title: Exclude current post from "recent posts widget"
body: <p>In a plugin for displaying recent posts in your sidebar widget, how can we apply a filter to the plugin's functions.php so that it won't include the current page/post in the display?</p>
  <p>The plugin author replied, before he entered a long silence: &quot;You can add custom parameter to the <code>rpwe_default_query_arguments</code> filter. Just add <code>exclude =&gt; get_the_ID()</code> to the filter.&quot;</p>
  <p>Is it here, that we add it?</p>
  <pre><code>// Allow plugins/themes developer to filter the default query.
      $query = apply_filters( 'rpwe_default_query_arguments', $query );
  </code></pre>
  <p>How?</p>
  <p>This is the plugin: <a href="https://wordpress.org/plugins/recent-posts-widget-extended/" rel="nofollow noreferrer">https://wordpress.org/plugins/recent-posts-widget-extended/</a></p>
  <hr />
  <p>I found <a href="http://themeshaper.com/2009/05/03/filters-wordpress-child-themes/" rel="nofollow noreferrer">some guidance</a> that appears to be quite simple
  but then it results in errors in my site (localhost) while trying to correct the syntax.  <code>=&gt;</code> seems to be not correctly used.</p>
  <p>This is what I have so far:</p>
  <pre><code>add_filter( 'rpwe_default_query_arguments', 'rpwe_exclude_current' );
  function rpwe_exclude_current ( $query ) {
      'exclude' =&gt; get_the_ID()
      $posts = new WP_Query( $query );
      return $posts;
  }
  </code></pre>