[wp-hackers] Alternative to posts_where hook

Brian Layman bulk at thecodecave.com
Tue Aug 10 05:34:21 UTC 2010


> On Mon, Aug 9, 2010 at 8:34 PM, Rich ZenMaster <richzenmaster at gmail.com>
> wrote:
> > http://wpseek.com/hook/posts_where/
> I don't know why this site marks posts_where as deprecated.
> > http://adambrown.info/p/wp_hooks/hook/posts_where
> This claims posts_where is not in 3.0, but it is

Adam's site is automated to look for exact code but in 3.0 there were subtle
changes that do not affect the behavior but do break his auto-documenting
site.

In this example it is a change to use apply_filters_ref_array:

OLD-
$where = apply_filters('posts_where', $where);

NEW-
$where = apply_filters_ref_array('posts_where', array( $where, &$this ) );
______________________________________________
Brian Layman
eHermits, Inc.
TheCodeCave.com / eHermitsInc.com / twitter.com/BrianLayman /
facebook.com/eHermit





More information about the wp-hackers mailing list