2012-04-07, 06:12:08
@mvlcek
I used hook search-veto in a small plugin I made (to exclude pages with date set in the future from search results).
It works, but: is it the correct way to use this hook? Any suggestions?
Thanks.
I used hook search-veto in a small plugin I made (to exclude pages with date set in the future from search results).
It works, but: is it the correct way to use this hook? Any suggestions?
Code:
...
add_filter('search-veto','hidefuturepages_search');
...
function hidefuturepages_search($item) {
return ( intval($item->pubDate) >= intval(strtotime(date('r'))) );
}
Thanks.