[wp-hackers] Creating an "Author Cafe"

Austin Matzko if.website at gmail.com
Thu Oct 1 09:50:18 UTC 2009


On Thu, Oct 1, 2009 at 12:32 AM, William Canino
<william.canino at googlemail.com> wrote:
> I'm thinking of creating one post, comments enabled, say post_id =
> 100, that is visible only to authors and editors.  This post mustn't
> appear in feeds or to non-authors, and its comments mustn't appear in
> the comments feed.
>
> All the plugins I've seen that offer to do this seem to use a WP_Query
> filter callback. It seems a big waste for the blog to scan each and
> every query post array and take out this one post for 99% of the
> world.  Is there a better way?  Do you have a better suggestion?

You could use the posts_where filter, and append a WHERE clause to
every non-relevant query:

" AND {$wpdb->posts}.ID != 100"


More information about the wp-hackers mailing list