Bypass category filtering if fetching specific posts

git-svn-id: https://develop.svn.wordpress.org/trunk@826 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dougal Campbell 2004-02-03 16:04:04 +00:00
parent 6b8ee14b77
commit 0037ea35ec
1 changed files with 3 additions and 2 deletions

View File

@ -145,7 +145,8 @@ foreach ($dogs as $catt) {
$cache_categories[$catt->cat_ID] = $catt;
}
if ((empty($cat)) || ($cat == 'all') || ($cat == '0')) {
// Bypass cat checks if fetching specific posts
if ((empty($cat)) || ($cat == 'all') || ($cat == '0') || (intval($year) || intval($p))) {
$whichcat='';
} else {
$cat = ''.urldecode($cat).'';
@ -341,7 +342,7 @@ if ($preview) {
}
// error_log("$request");
// echo $request;
echo $request;
$posts = $wpdb->get_results($request);
// No point in doing all this work if we didn't match any posts.