title: hide password protected posts from wordpress loop
body: <p>I found this in the codex:</p>
  
  <pre><code>// Filter to hide protected posts
  function exclude_protected($where) {
      global $wpdb;
      return $where .= " AND {$wpdb-&gt;posts}.post_password = '' ";
  }
  
  // Decide where to display them
  function exclude_protected_action($query) {
      if( !is_single() &amp;&amp; !is_page() &amp;&amp; !is_admin() ) {
          add_filter( 'posts_where', 'exclude_protected' );
      }
  }
  
  // Action to queue the filter at the right time
  add_action('pre_get_posts', 'exclude_protected_action');
  </code></pre>
  
  <p>But it didn't work. Perhaps because I've customised my loop. I was hoping to do something simple, along these lines:</p>
  
  <pre><code>&lt;?php $postsLatest = get_posts('numberposts=10&amp;passwordproteced=false'); foreach($postsLatest as $post) { ?&gt;
  </code></pre>
  
  <p>Is that possible?</p>